changeset 10283:a1c48e2fc4cc octave-forge

control-devel: minor enhancements for error messages
author paramaniac
date Sun, 20 May 2012 15:13:10 +0000
parents c37a0cc39224
children 73300ddd8d24
files extra/control-devel/inst/__slicot_identification__.m extra/control-devel/inst/moen4.m extra/control-devel/inst/moesp.m extra/control-devel/inst/n4sid.m
diffstat 4 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/extra/control-devel/inst/__slicot_identification__.m	Sun May 20 14:49:09 2012 +0000
+++ b/extra/control-devel/inst/__slicot_identification__.m	Sun May 20 15:13:10 2012 +0000
@@ -10,6 +10,10 @@
     otherwise
       error ("ident: invalid method");  # should never happen
   endswitch
+  
+  if (! isa (dat, "iddata"))
+    error ("%s: first argument must be an 'iddata' dataset", method);
+  endif
 
   alg = 0;
   conct = 1;
--- a/extra/control-devel/inst/moen4.m	Sun May 20 14:49:09 2012 +0000
+++ b/extra/control-devel/inst/moen4.m	Sun May 20 15:13:10 2012 +0000
@@ -28,6 +28,10 @@
 
 function [sys, x0] = moen4 (varargin)
 
+  if (nargin == 0)
+    print_usage ();
+  endif
+
   [sys, x0] = __slicot_identification__ ("moen4", varargin{:});
 
 endfunction
\ No newline at end of file
--- a/extra/control-devel/inst/moesp.m	Sun May 20 14:49:09 2012 +0000
+++ b/extra/control-devel/inst/moesp.m	Sun May 20 15:13:10 2012 +0000
@@ -26,6 +26,10 @@
 
 function [sys, x0] = moesp (varargin)
 
+  if (nargin == 0)
+    print_usage ();
+  endif
+
   [sys, x0] = __slicot_identification__ ("moesp", varargin{:});
 
 endfunction
\ No newline at end of file
--- a/extra/control-devel/inst/n4sid.m	Sun May 20 14:49:09 2012 +0000
+++ b/extra/control-devel/inst/n4sid.m	Sun May 20 15:13:10 2012 +0000
@@ -26,6 +26,10 @@
 
 function [sys, x0] = n4sid (varargin)
 
+  if (nargin == 0)
+    print_usage ();
+  endif
+
   [sys, x0] = __slicot_identification__ ("n4sid", varargin{:});
 
 endfunction
\ No newline at end of file