diff scripts/linear-algebra/subspace.m @ 7612:c1702f963a5e

error check for subspace.m
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 20 Mar 2008 09:36:50 -0400
parents 4f903c303c3c
children fb4fa07bc364
line wrap: on
line diff
--- a/scripts/linear-algebra/subspace.m
+++ b/scripts/linear-algebra/subspace.m
@@ -34,6 +34,12 @@
 
 function ang = subspace (a, b)
 
+  if (nargin != 2)
+    print_usage ();
+  elseif (ndims (a) != 2 || ndims (b) != 2)
+    error ("subspace: expecting A and B to be 2-dimensional arrays");
+  endif
+
   a = orth (a);
   b = orth (b);
   c = a'*b;