Page 47 - MATLAB an introduction with applications
P. 47
32 ——— MATLAB: An Introduction with Applications
surfc This function is related to surf in the same way that meshc is related to mesh.
Colormap Used to change the default coloring of a figure. See the MATLAB reference manual or the help
file.
Shading Controls the type of color shading used in drawing figures. See the MATLAB reference manual
or the help file.
view view(az,el) controls the perspective view of a three-dimensional plot. The view of the figure is
from angle “el” above the xy plane with the coordinate axes (and the figure) rotated by an angle
“az” in a clockwise direction about the z axis. Both angles are in degrees. The default values
are az = 37½º and el = 30º.
axis Determines or changes the scaling of a plot. If the coordinate axis limits of a two-dimensional
or three-dimensional graph are contained in the row vector r = [x min , x max , y min , y max , z min , z max ],
axis will return the values in this vector, and axis(r) can be used to alter them. The coordinate
axes can be turned on and off with axis(‘on’) and axis(‘off’). A few other string constant
inputs to axis and their effects are given below:
axis(‘equal’) x and y scaling are forced to be the same.
axis(‘square’) The box formed by the axes is square.
axis(‘auto’) Restores the scaling to default settings.
axis(‘normal’) Restoring the scaling to full size, removing any effects of square or equal
settings.
axis(‘image’) Alters the aspect ratio and the scaling so the screen pixels are square shaped
rather than rectangular.
contour The use is contour(x,y,z). A default value of N = 10 contour lines will be drawn. An optional
fourth argument can be used to control the number of contour lines that are drawn.
contour(x,y,z,N), if N is a positive integer, will draw N contour lines, and contour(x,y,z,V), if
V is a vector containing values in the range of z values, will draw contour lines at each value of
z = V.
plot3 Plots lines or curves in three dimensions. If x, y, and z are vectors of equal length, plot3(x,y,z)
will draw, on a three-dimensional coordinate axis system, the lines connecting the points. A
fourth argument, representing the color and symbols to be used at each point, can be added in
exactly the same manner as with plot.
grid grid on adds grid lines to a two-dimensional or three-dimensional graph; grid off removes
them.
slice Draws “slices” of a volume at a particular location within the volume.
Example E1.5:
(a) Generate an overlay plot for plotting three lines
y = sin t
1
y = t
2
t 3 t 5 t 7
+
+
y = t – 3! 5! 7! ; 0 ≤ t ≤ 2π
3
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09