Functions | |
if (nargin!=1 &&nargin!=3) print_usage() | |
endif | if (nargin==1) z |
endif | if (nargout==0) endif xx |
* | xx (end,:)-xx(end-1 |
* | yy (end,:)-yy(end-1 |
* | zz (end,:)-zz(end-1 |
newplot () | |
surf (x, y, z, varargin{ioff:end}) | |
plot3 ([x(:)';x(:).'+nx(:).';NaN(size(x(:).'))](:),[y(:)';y(:).'+ny(:).';NaN(size(y(:).'))](:),[z(:)';z(:).'+nz(:).';NaN(size(z(:).'))](:), varargin{ioff:end}) | |
unwind_protect_cleanup | set (h,"nextplot", old_hold_state) |
end_unwind_protect unwind_protect_cleanup | axes (oldh) |
endif endfunction!demo | !colormap (jet(64))%![x |
!surfnorm (x, y, z) | |
!demo | !surfnorm (peaks(10)) |
!demo | !surfnorm (peaks(32)) |
Variables | |
function [Nx, Ny, Nz] | |
ioff = meshgrid (1:size(z,1), 1:size(z,2)) 2 | |
else | x = varargin{1} |
y = varargin{2} | |
z = varargin{3} | |
xx = [2 .* xx(1,:) - xx(2,:) | |
* | yy = [2 .* y(:,1) - y(:,2), y, 2 .* y(:,end) - y(:,end-1)] |
* | zz = [2 .* z(:,1) - z(:,2), z, 2 .* z(:,end) - z(:,end-1)] |
c = cross ([u.x(:), u.y(:), u.z(:)], [v.x(:), v.y(:), v.z(:)]) | |
nx | |
ny | |
nz | |
len = sqrt (nx.^2 + ny.^2 + nz.^2) | |
unwind_protect | axes (h) |
old_hold_state = get (h, "nextplot") | |
unwind_protect | set (h,"nextplot","add") |
end_unwind_protect else | Nx = nx |
Ny = ny | |
Nz = nz |
endif endfunction !demo !colormap | ( | jet(64) | ) |
!demo !surfnorm | ( | peaks(32) | ) |
!demo !surfnorm | ( | peaks(10) | ) |
!surfnorm | ( | x | , | |
y | , | |||
z | ||||
) |
end_unwind_protect unwind_protect_cleanup axes | ( | oldh | ) |
endif if | ( | nargout | = =0 |
) |
if | ( | nargin! | = 1 &&nargin!=3 |
) |
newplot | ( | ) |
plot3 | ( | [x(:)';x(:).'+nx(:).';NaN(size(x(:).'))] (:) | , | |
[y(:)';y(:).'+ny(:).';NaN(size(y(:).'))] (:) | , | |||
[z(:)';z(:).'+nz(:).';NaN(size(z(:).'))] (:) | ||||
) |
unwind_protect_cleanup set | ( | h | , | |
"nextplot" | , | |||
old_hold_state | ||||
) |
surf | ( | x | , | |
y | , | |||
z | ||||
) |
* xx | ( | end | , | |
: | ||||
) |
* yy | ( | end | , | |
: | ||||
) |
* zz | ( | end | , | |
: | ||||
) |
c = cross ([u.x(:), u.y(:), u.z(:)], [v.x(:), v.y(:), v.z(:)]) |
ioff = meshgrid (1:size(z,1), 1:size(z,2)) 2 |
len = sqrt (nx.^2 + ny.^2 + nz.^2) |
old_hold_state = get (h, "nextplot") |
unwind_protect set(h,"nextplot","add") |
w x = varargin{1} |
xx = [2 .* xx(1,:) - xx(2,:) |
endif endfunction !demo y = varargin{2} |
yy = [2 .* y(:,1) - y(:,2), y, 2 .* y(:,end) - y(:,end-1)] |
endif endfunction !demo z = varargin{3} |
zz = [2 .* z(:,1) - z(:,2), z, 2 .* z(:,end) - z(:,end-1)] |