3 - D Plots
<>
Curves
   
To plot: MATLAB statements
x = cos t
y = sin t
z = t /4
0 <= t <= 2p
t = 0: .05: 2 * pi;
x = cos(t);
y = sin(t);
z = t/4;
plot3(x,y,z)

or try

comet3(x, y, z)


Cylinders

 
Rotate around  z axis MATLAB statements
z = 2x2,  0 <= x <= 1 x = 0: .05: 1;
z = 2* x.^2;
cylinder(z)

or try these:

cylinder(z, 8)
cylinder(z, 30)

 

Graphs of z = f(x, y)
 
To plot MATLAB statements
z = cos(x)sin(y)
-1 <= x <= 1
-2 <= y <= 2
x1 = -1: .1 : 1;
y1 = -2: .1 : 2;
[x y] = meshgrid(x,y);
z = cos(x) .* sin(y)
surf(x, y, z)

or try these:

surfc(x,y,z)
mesh(x, y, z)
surfl(x, y, z)
meshc(x, y, z)
waterfall(x, y, z)