diff scripts/plot/surface.m @ 13194:3e1871badab9

allow sscanf to accept character arrays with more than one row * file-io.cc (get_sscanf_data): New function. Flatten character arrays before extracting character data. (Fsscanf): Use it. * test_io.m: New sscanf test.
author John W. Eaton <jwe@octave.org>
date Mon, 19 Sep 2011 16:45:31 -0400
parents e81ddf9cacd5
children 5f0bb45e615c
line wrap: on
line diff
--- a/scripts/plot/surface.m
+++ b/scripts/plot/surface.m
@@ -80,9 +80,12 @@
     z = varargin{3};
     c = varargin{4};
 
-    if (! size_equal (z, c))
+    [z_nr, z_nc] = size (z);
+    [c_nr, c_nc, c_np] = size (c);
+    if (! (z_nr == c_nr && z_nc == c_nc && (c_np == 1 || c_np == 3)))
       error ("surface: Z and C must have the same size");
     endif
+
     if (isvector (x) && isvector (y) && ismatrix (z))
       if (rows (z) == length (y) && columns (z) == length (x))
         x = x(:)';