From: <par...@us...> - 2011-11-19 20:44:48
|
Revision: 9140 http://octave.svn.sourceforge.net/octave/?rev=9140&view=rev Author: paramaniac Date: 2011-11-19 20:44:42 +0000 (Sat, 19 Nov 2011) Log Message: ----------- control-devel: work on option structs Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/__opt2cell__.m trunk/octave-forge/extra/control-devel/inst/bstmodred.m trunk/octave-forge/extra/control-devel/inst/btamodred.m trunk/octave-forge/extra/control-devel/inst/hnamodred.m trunk/octave-forge/extra/control-devel/inst/options.m trunk/octave-forge/extra/control-devel/inst/spamodred.m Modified: trunk/octave-forge/extra/control-devel/inst/__opt2cell__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__opt2cell__.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/__opt2cell__.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -1,3 +1,28 @@ +## Copyright (C) 2011 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Convert option struct to a cell with field names as keys and +## field values as values. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + function c = __opt2cell__ (opt) if (! isstruct (opt)) Modified: trunk/octave-forge/extra/control-devel/inst/bstmodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/bstmodred.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/bstmodred.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -16,7 +16,9 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} bstmodred (@var{sys}, @dots{}) +## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} bstmodred (@var{sys}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} bstmodred (@var{sys}, @dots{}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} bstmodred (@var{sys}, @var{opt}) ## Model order reduction by Balanced Stochastic Truncation method. ## Uses the stochastic balancing approach in conjunction with the square-root or ## the balancing-free square-root Balance & Truncate (B&T) Modified: trunk/octave-forge/extra/control-devel/inst/btamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/btamodred.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/btamodred.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -16,7 +16,9 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} btamodred (@var{sys}, @dots{}) +## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} btamodred (@var{sys}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} btamodred (@var{sys}, @dots{}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} btamodred (@var{sys}, @var{opt}) ## Model order reduction by frequency weighted optimal Hankel-norm approximation method. ## ## @strong{Inputs} Modified: trunk/octave-forge/extra/control-devel/inst/hnamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -16,7 +16,9 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysr}, @var{info}] =} hnamodred (@var{sys}, @dots{}) +## @deftypefn{Function File} {[@var{sysr}, @var{info}] =} hnamodred (@var{sys}) +## @deftypefnx{Function File} {[@var{sysr}, @var{info}] =} hnamodred (@var{sys}, @dots{}) +## @deftypefnx{Function File} {[@var{sysr}, @var{info}] =} hnamodred (@var{sys}, @var{opt}) ## Model order reduction by frequency weighted optimal Hankel-norm approximation method. ## ## @strong{Inputs} Modified: trunk/octave-forge/extra/control-devel/inst/options.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/options.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/options.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -1,3 +1,60 @@ +## Copyright (C) 2011 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {@var{opt} =} options (@var{"key1"}, @var{value1}, @var{"key2"}, @var{value2}, @dots{}) +## Create options struct @var{opt} from a number of property and value pairs. +## For use with order reduction commands. +## +## @strong{Inputs} +## @table @var +## @item key, property +## The name of the property. +## @item value +## The value of the property. +## @end table +## +## @strong{Outputs} +## @table @var +## @item opt +## Struct with fields for each key. +## @end table +## +## @strong{Example} +## @example +## @group +## octave:1> opt = options ("method", "spa", "tol", 1e-6) +## opt = +## +## scalar structure containing the fields: +## +## method = spa +## tol = 1.0000e-06 +## +## octave:2> +## @end group +## @end example +## +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + function opt = options (varargin) if (nargin == 0) @@ -11,6 +68,6 @@ key = reshape (varargin(1:2:end-1), [], 1); val = reshape (varargin(2:2:end), [], 1); - opt = cell2struct (val, key, 1) + opt = cell2struct (val, key, 1); endfunction \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/inst/spamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/spamodred.m 2011-11-19 18:01:27 UTC (rev 9139) +++ trunk/octave-forge/extra/control-devel/inst/spamodred.m 2011-11-19 20:44:42 UTC (rev 9140) @@ -16,7 +16,9 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} spamodred (@var{sys}, @dots{}) +## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} spamodred (@var{sys}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} spamodred (@var{sys}, @dots{}) +## @deftypefnx{Function File} {[@var{sysr}, @var{nr}] =} spamodred (@var{sys}, @var{opt}) ## Model order reduction by frequency weighted optimal Hankel-norm approximation method. ## ## @strong{Inputs} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |