From: <par...@us...> - 2010-08-31 00:36:57
|
Revision: 7613 http://octave.svn.sourceforge.net/octave/?rev=7613&view=rev Author: paramaniac Date: 2010-08-31 00:36:50 +0000 (Tue, 31 Aug 2010) Log Message: ----------- control: improve argument checking, include forgotten tests Modified Paths: -------------- trunk/octave-forge/main/control/inst/ctrb.m trunk/octave-forge/main/control/inst/obsv.m trunk/octave-forge/main/control/inst/test_control.m Modified: trunk/octave-forge/main/control/inst/ctrb.m =================================================================== --- trunk/octave-forge/main/control/inst/ctrb.m 2010-08-30 20:24:38 UTC (rev 7612) +++ trunk/octave-forge/main/control/inst/ctrb.m 2010-08-31 00:36:50 UTC (rev 7613) @@ -26,15 +26,17 @@ ## Created: November 4, 1997 ## based on is_controllable.m of Scottedward Hodel -function co = ctrb (sys_or_a, b) +function co = ctrb (a, b) - if (nargin == 1) - [a, b] = ssdata (sys_or_a); - elseif (nargin == 2) - a = sys_or_a; + if (nargin == 1) # ctrb (sys) + if (! isa (a, "lti")) + error ("ctrb: argument must be an lti system"); + endif + [a, b] = ssdata (a); + elseif (nargin == 2) # ctrb (a, b) if (! isnumeric (a) || ! isnumeric (b) || - rows(a) != rows (b) || ! issquare (a)) - error ("ctrb: invalid arguments"); + rows (a) != rows (b) || ! issquare (a)) + error ("ctrb: invalid arguments (a, b)"); endif else print_usage (); Modified: trunk/octave-forge/main/control/inst/obsv.m =================================================================== --- trunk/octave-forge/main/control/inst/obsv.m 2010-08-30 20:24:38 UTC (rev 7612) +++ trunk/octave-forge/main/control/inst/obsv.m 2010-08-31 00:36:50 UTC (rev 7613) @@ -26,15 +26,17 @@ ## Author: Kai P. Mueller <mu...@if...> ## Created: November 4, 1997 -function ob = obsv (sys_or_a, c) +function ob = obsv (a, c) - if (nargin == 1) - [a, b, c] = ssdata (sys_or_a); - elseif (nargin == 2) - a = sys_or_a; + if (nargin == 1) # obsv (sys) + if (! isa (a, "lti")) + error ("obsv: argument must be an lti system"); + endif + [a, b, c] = ssdata (a); + elseif (nargin == 2) # obsv (a, c) if (! isnumeric (a) || ! isnumeric (c) || - columns(a) != columns (c) || ! issquare (a)) - error ("obsv: invalid arguments"); + columns (a) != columns (c) || ! issquare (a)) + error ("obsv: invalid arguments (a, c)"); endif else print_usage (); Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2010-08-30 20:24:38 UTC (rev 7612) +++ trunk/octave-forge/main/control/inst/test_control.m 2010-08-31 00:36:50 UTC (rev 7613) @@ -22,21 +22,33 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: May 2010 -## Version: 0.1 +## Version: 0.2 +## test collection test ltimodels + +## robust control test hinfsyn test h2syn -test place + +## ARE solvers test care +## test dare # TODO: add missing test +test kalman -test kalman +## Lyapunov test lyap test dlyap test gram test covar +## various oct-files +test place +test hsvd + +## various m-files test margin test sigma test initial -test hsvd \ No newline at end of file +test ctrb +test obsv \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |