From: <par...@us...> - 2012-08-01 15:45:56
|
Revision: 10796 http://octave.svn.sourceforge.net/octave/?rev=10796&view=rev Author: paramaniac Date: 2012-08-01 15:45:50 +0000 (Wed, 01 Aug 2012) Log Message: ----------- control-devel: improve argument checking Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-07-31 15:34:36 UTC (rev 10795) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-08-01 15:45:50 UTC (rev 10796) @@ -72,7 +72,7 @@ conct = 1; # no connection between experiments ctrl = 1; # don't confirm order n rcond = 0.0; - tol = -1.0; % 0; + tol = -1.0; s = []; n = []; conf = []; @@ -83,16 +83,27 @@ key = lower (varargin{k}); val = varargin{k+1}; switch (key) - ## TODO: proper argument checking case {"n", "order"} + if (! issample (val, 0) || val != round (val)) + error ("%s: 'n' must be a positive integer", method); + endif n = val; case "s" + if (! issample (val, 0) || val != round (val)) + error ("%s: 's' must be a positive integer", method); + endif s = val; case {"alg", "algorithm"} error ("alg"); case "tol" + if (! is_real_scalar (val)) + error ("%s: tolerance 'tol' must be a real scalar", method); + endif tol = val; case "rcond" + if (! is_real_scalar (val)) + error ("%s: 'rcond' must be a real scalar", method); + endif rcond = val; case "confirm" conf = logical (val); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |