Diff of /inst/mktito.m [a4d905] .. [967f1d]  Maximize  Restore

  Switch to side-by-side view

--- a/inst/mktito.m
+++ b/inst/mktito.m
@@ -80,13 +80,12 @@
   
   [p, m] = size (P);
   
-  ## TODO: improve argument checking
-  if (! is_real_scalar (nmeas))
-    error ("mktito: second argument invalid");
+  if (! is_index (nmeas, p))
+    error ("mktito: second argument 'nmeas' invalid");
   endif
   
-  if (! is_real_scalar (ncon))
-    error ("mktito: third argument invalid");
+  if (! is_index (ncon, m))
+    error ("mktito: third argument 'ncon' invalid");
   endif
   
   outgroup = struct ("Z", 1:p-nmeas, "V", p-nmeas+1:p);
@@ -99,3 +98,11 @@
               "outname", outname, "inname", inname);
 
 endfunction
+
+
+function bool = is_index (idx, s)
+
+  ## (idx < s) and not (idx <= s) because we need at least one Z or W
+  bool = is_real_scalar (idx) && fix (idx) == idx && idx > 0 && idx < s
+
+endfunction

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks