changeset 602:f888ae024db8

corr2: use private isimage function for input check
author carandraug
date Mon, 24 Sep 2012 13:32:36 +0000
parents 1ebad94b5288
children 99e274772dae
files inst/corr2.m
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/inst/corr2.m
+++ b/inst/corr2.m
@@ -25,16 +25,11 @@
 
   if (nargin != 2)
     print_usage ();
-  endif
-
-  if (!(ismatrix (I) && isreal (I) && ismatrix (J) && isreal (J)))
-    error ("corr2: argument must be a real type matrix");
-  endif
-
-  if (!size_equal (I, J))
+  elseif (!ismage (I) || !isimage (J))
+    error ("corr2: argument must be real matrices");
+  elseif (!size_equal (I, J))
     error ("corr2: arguments must be of same size")
   endif
-  
   r = cov (I (:), J (:)) / (std2 (I) * std2 (J));
+
 endfunction
-