Graphics Programs Reference
In-Depth Information
The lemniscate x 2 -y 2 =(x 2 +y 2 ) 2
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Figure5-3
Field Plots
The MATLAB routine quiver is used to plot vector fields or arrays of arrows.
The arrows can be located at equally spaced points in the plane (if x and y
coordinates are not given explicitly), or they can be placed at specified loca-
tions. Sometimes some fiddling is required to scale the arrows so that they
don't come out looking too big or too small. For this purpose, quiver takes an
optional scale factor argument. The following code, for example, plots a vector
field witha “saddle point,” corresponding to a combination of an attractive
force pointing toward the x axis and a repulsive force pointing away from the
y axis:
>> [x, y] = meshgrid(-1.1:.2:1.1, -1.1:.2:1.1);
>> quiver(x, -y); axis equal; axis off
The output is shown in Figure 5-4.
Search WWH ::




Custom Search