
3.2 Creating 3D Graphs
Matlab offers fancy 3-dimensional line plots and surface graphs.
3.2.1 Creation of 3D Line Plots
There is the function:
p
p
l
l
o
o
t
t
3
3 which its use is similar as with the function:
p
p
l
l
o
o
t
t,
with the difference that an additional input argument corresponding to the
additional dimension is required (the additional dimension is symbolized as
“z”).
p
p
l
l
o
o
t
t
3
3 is used to plot lines or point coordinates in the 3D space. Let use
the
p
p
l
l
o
o
t
t
3
3 to create a 3D helix:
Matlab’s command:
>> clear; g=linspace(-5*pi,5*pi,200); plot3(sin(g),cos(g),g,'r*-');
>> xlabel('x'); ylabel('y'); zlabel('z'); title('A helix');
Matlab’s response:
-1
-0.5
0
0.5
1
-1
-0.5
0
0.5
1
-20
-15
-10
-5
0
5
10
15
20
x
A helix
y
z
Comments:
Creating a helix with the
p
p
l
l
o
o
t
t
3
3 function.
3.2.2 Creation of 3D Mesh and Surface Graphs
There are also many commands that lead to the creation of 3D surfaces.
Recall that to create a surface of two variables, at each pair of (x,y) a
Kommentare zu diesen Handbüchern