Mercurial > hg > octave-lyh
comparison 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 |
comparison
equal
deleted
inserted
replaced
13193:a00ff5cedb9b | 13194:3e1871badab9 |
---|---|
78 x = varargin{1}; | 78 x = varargin{1}; |
79 y = varargin{2}; | 79 y = varargin{2}; |
80 z = varargin{3}; | 80 z = varargin{3}; |
81 c = varargin{4}; | 81 c = varargin{4}; |
82 | 82 |
83 if (! size_equal (z, c)) | 83 [z_nr, z_nc] = size (z); |
84 [c_nr, c_nc, c_np] = size (c); | |
85 if (! (z_nr == c_nr && z_nc == c_nc && (c_np == 1 || c_np == 3))) | |
84 error ("surface: Z and C must have the same size"); | 86 error ("surface: Z and C must have the same size"); |
85 endif | 87 endif |
88 | |
86 if (isvector (x) && isvector (y) && ismatrix (z)) | 89 if (isvector (x) && isvector (y) && ismatrix (z)) |
87 if (rows (z) == length (y) && columns (z) == length (x)) | 90 if (rows (z) == length (y) && columns (z) == length (x)) |
88 x = x(:)'; | 91 x = x(:)'; |
89 y = y(:); | 92 y = y(:); |
90 else | 93 else |