comparison scripts/plot/draw/isosurface.m @ 21173:5ecdcc6320d9 stable

Fix regressions caused by ismatrix definition change (partial fix bug #47036). Replace ismatrix with calls to isnumeric where appropriate. Add test for isosurface regression. In interp2, ismatrix is correct but ndims check unnecessary. * interp2.m: Remove unneccessary check on ndims when ismatrix used. Clean up indentation. * isosurface.m: Replace ismatrix with isnumeric. Add BIST test.
author Colin Macdonald <cbm@m.fsf.org>
date Sun, 31 Jan 2016 22:59:08 -0800
parents 777f26aa8e3e
children 3be6a07e8bad
comparison
equal deleted inserted replaced
21172:5f62b5dae8b1 21173:5ecdcc6320d9
1 ## Copyright (C) 2009-2015 Martin Helm 1 ## Copyright (C) 2009-2016 Martin Helm
2 ## 2 ##
3 ## This file is part of Octave. 3 ## This file is part of Octave.
4 ## 4 ##
5 ## Octave is free software; you can redistribute it and/or modify it 5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by 6 ## under the terms of the GNU General Public License as published by
143 else 143 else
144 val = varargin{1}; 144 val = varargin{1};
145 [n2, n1, n3] = size (val); 145 [n2, n1, n3] = size (val);
146 [x, y, z] = meshgrid (1:n1, 1:n2, 1:n3); 146 [x, y, z] = meshgrid (1:n1, 1:n2, 1:n3);
147 iso = varargin{2}; 147 iso = varargin{2};
148 if (nargin >= 3 && ismatrix (varargin{3})) 148 if (nargin >= 3 && isnumeric (varargin{3}))
149 colors = varargin{3}; 149 colors = varargin{3};
150 calc_colors = true; 150 calc_colors = true;
151 endif 151 endif
152 endif 152 endif
153 if (calc_colors) 153 if (calc_colors)
230 %! [f, v, c] = isosurface (x, y, z, val, .3, y); 230 %! [f, v, c] = isosurface (x, y, z, val, .3, y);
231 %! assert (size (f), [1 3]); 231 %! assert (size (f), [1 3]);
232 %! assert (size (v), [3 3]); 232 %! assert (size (v), [3 3]);
233 %! assert (size (c), [3 1]); 233 %! assert (size (c), [3 1]);
234 234
235 %!test
236 %! [f, v, c] = isosurface (val, .3, y);
237 %! assert (size (f), [1 3]);
238 %! assert (size (v), [3 3]);
239 %! assert (size (c), [3 1]);
240