Mercurial > octave-nkf
comparison scripts/plot/private/__interp_cube__.m @ 10635:d1978e7364ad
Print name of function in error() string messages.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 16 May 2010 22:26:54 -0700 |
parents | 1aeb39118764 |
children | 2c356a35d7f5 |
comparison
equal
deleted
inserted
replaced
10634:60542efcfa2c | 10635:d1978e7364ad |
---|---|
29 elseif (isvector (x) && isvector (y) && isvector (z) ) | 29 elseif (isvector (x) && isvector (y) && isvector (z) ) |
30 x = x(:); | 30 x = x(:); |
31 y = y(:); | 31 y = y(:); |
32 z = z(:); | 32 z = z(:); |
33 else | 33 else |
34 error("x, y, z have wrong dimensions"); | 34 error("__interp_cube__: x, y, z have wrong dimensions"); |
35 endif | 35 endif |
36 if (size (val) != [length(x), length(y), length(z)]) | 36 if (size (val) != [length(x), length(y), length(z)]) |
37 error ("val has wrong dimensions"); | 37 error ("__interp_cube__: val has wrong dimensions"); |
38 endif | 38 endif |
39 if (size (v, 2) != 3) | 39 if (size (v, 2) != 3) |
40 error ( "v has to be N*3 matrix"); | 40 error ( "v has to be N*3 matrix"); |
41 endif | 41 endif |
42 if (!ischar (req)) | 42 if (!ischar (req)) |
43 error ("Invalid request parameter use 'values', 'normals' or 'normals8'"); | 43 error ("__interp_cube__: Invalid request parameter use 'values', 'normals' or 'normals8'"); |
44 endif | 44 endif |
45 if (isempty (v)) | 45 if (isempty (v)) |
46 Vxyz = idx = frac = []; | 46 Vxyz = idx = frac = []; |
47 return | 47 return |
48 endif | 48 endif |
92 dy = [dy;dy(end)](idx(:,1)); | 92 dy = [dy;dy(end)](idx(:,1)); |
93 dz = [dz;dz(end)](idx(:,3)); | 93 dz = [dz;dz(end)](idx(:,3)); |
94 [Dx, Dy, Dz, idx, frac] = interp_cube_trilin_grad (x, y, z, val, v); | 94 [Dx, Dy, Dz, idx, frac] = interp_cube_trilin_grad (x, y, z, val, v); |
95 Vxyz = [Dx./dx, Dy./dy, Dz./dz]; | 95 Vxyz = [Dx./dx, Dy./dy, Dz./dz]; |
96 otherwise | 96 otherwise |
97 error ("Invalid request type '%s', use 'values', 'normals' or 'normals8'", req); | 97 error ("__interp_cube__: Invalid request type '%s', use 'values', 'normals' or 'normals8'", req); |
98 endswitch | 98 endswitch |
99 endfunction | 99 endfunction |
100 | 100 |
101 function [Vxyz, idx, frac] = interp_cube_trilin(x, y, z, val, v) | 101 function [Vxyz, idx, frac] = interp_cube_trilin(x, y, z, val, v) |
102 [idx, frac] = cube_idx (x(:), y(:), z(:), v); | 102 [idx, frac] = cube_idx (x(:), y(:), z(:), v); |