Functions | |
if (nargin > 1) print_usage() | |
elseif (nargin==1) n | |
if (nargout > 0) xx | |
else | surf (h, x, y, z) |
Variables | |
function [xx, yy, zz] | |
else | n = 20 |
endif | theta = linspace (0, 2*pi, n+1) |
phi = linspace (-pi/2, pi/2, n+1) | |
x = meshgrid (theta, phi) cos (phi) .* cos (theta) | |
y = cos (phi) .* sin (theta) | |
z = sin (phi) | |
yy = y | |
zz = z |
elseif | ( | nargin | = =1 |
) |
if | ( | nargout | , | |
0 | ||||
) |
if | ( | nargin | , | |
1 | ||||
) |
else surf | ( | h | , | |
x | , | |||
y | , | |||
z | ||||
) |
function[xx, yy, zz] |
else n = 20 |
yy = y |
z = sin (phi) |
zz = z |