
- •If your function has additional parameters, for example k in myfun:
- •If your function has additional parameters, for example k1,k2 in myfun:
- •Is collected along a path.
- •Vector y are drawn as bars in descending order. Each bar will
- •Vector the same length a X and y or a scalar. If s is a scalar,
- •X and y such that plot(XX,yy) is the stairstep graph.
- •Contour and 2-1/2 d graphs
- •X and y data must be consistently sorted in that if the first
- •2 Inches.
- •If your function has additional parameters, for example k in myfun:
- •If your function has additional parameters, for example k in myfun:
- •Specialized 3-d graphs
- •Inputs.
- •If your function has additional parameters, for example k in myfun:
- •If your function has additional parameters, for example k in myfun:
- •If your function has additional parameters, for example k in myfuntk:
- •If your function has additional parameters, for example k in myfun:
- •If your function has additional parameters, for example k in myfun:
- •Is drawn beneath the mesh.
- •Values in X are normalized via X/sum(X) to determine the area of
- •Volume array.
- •Vector data u,V. The arrays X,y define the coordinates for u,V and
- •Instead of an arrow on the tip. Use a marker of '.' to specify
- •Instead of an arrow on the tip. Use a marker of '.' to specify
- •Interpreted.
- •Instead of the current axes.
- •Imread Read image from graphics file.
- •In the structure returned from imfinfo function.
- •In order to create a cmyk tiff, the colorspace
- •In addition to these png parameters, you can use any
- •Images), 'rle' (run-length encoding of 1-bit
- •Image(f.Cdata);
- •In the movie. For example, if m has four frames then
- •Color related functions
- •Solid modeling
Instead of an arrow on the tip. Use a marker of '.' to specify
no marker at all. See PLOT for other possibilities.
QUIVER3(...,'filled') fills any markers specified.
QUIVER3(AX,...) plots into AX instead of GCA.
H = QUIVER3(...) returns a quiver object.
Example:
[x,y] = meshgrid(-2:.2:2,-1:.15:1);
z = x .* exp(-x.^2 - y.^2);
[u,v,w] = surfnorm(x,y,z);
quiver3(x,y,z,u,v,w); hold on, surf(x,y,z), hold off
See also quiver, plot, plot3, scatter.
Reference page in Help browser
doc quiver3
<quiver> - 2D quiver plot.
QUIVER Quiver plot.
QUIVER(X,Y,U,V) plots velocity vectors as arrows with components (u,v)
at the points (x,y). The matrices X,Y,U,V must all be the same size
and contain corresponding position and velocity components (X and Y
can also be vectors to specify a uniform grid). QUIVER automatically
scales the arrows to fit within the grid.
QUIVER(U,V) plots velocity vectors at equally spaced points in
the x-y plane.
QUIVER(U,V,S) or QUIVER(X,Y,U,V,S) automatically scales the
arrows to fit within the grid and then stretches them by S. Use
S=0 to plot the arrows without the automatic scaling.
QUIVER(...,LINESPEC) uses the plot linestyle specified for
the velocity vectors. Any marker in LINESPEC is drawn at the base
Instead of an arrow on the tip. Use a marker of '.' to specify
no marker at all. See PLOT for other possibilities.
QUIVER(...,'filled') fills any markers specified.
QUIVER(AX,...) plots into AX instead of GCA.
H = QUIVER(...) returns a quivergroup handle.
Example:
[x,y] = meshgrid(-2:.2:2,-1:.15:1);
z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15);
contour(x,y,z), hold on
quiver(x,y,px,py), hold off, axis image
See also feather, quiver3, plot.
Reference page in Help browser
doc quiver
<divergence> - Divergence of a vector field.
DIVERGENCE Divergence of a vector field.
DIV = DIVERGENCE(X,Y,Z,U,V,W) computes the divergence of a 3-D
vector field U,V,W. The arrays X,Y,Z define the coordinates for
U,V,W and must be monotonic and 3-D plaid (as if produced by
MESHGRID).
DIV = DIVERGENCE(U,V,W) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(U).
DIV = DIVERGENCE(X,Y,U,V) computes the divergence of a 2-D
vector field U,V. The arrays X,Y define the coordinates for U,V
and must be monotonic and 2-D plaid (as if produced by
MESHGRID).
DIV = DIVERGENCE(U,V) assumes
[X Y] = meshgrid(1:N, 1:M) where [M,N]=SIZE(U).
Example:
load wind
div = divergence(x,y,z,u,v,w);
slice(x,y,z,div,[90 134],[59],[0]); shading interp
daspect([1 1 1])
camlight
See also streamtube, curl, isosurface.
Reference page in Help browser
doc divergence
<curl> - Curl and angular velocity of a vector field.
CURL Curl and angular velocity of a vector field.
[CURLX, CURLY, CURLZ, CAV] = CURL(X,Y,Z,U,V,W) computes the
curl and angular velocity perpendicular to the flow (in radians
per time unit) of a 3D vector field U,V,W. The arrays X,Y,Z
define the coordinates for U,V,W and must be monotonic and 3D
plaid (as if produced by MESHGRID).
[CURLX, CURLY, CURLZ, CAV] = CURL(U,V,W) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(U).
[CURLZ, CAV]= CURL(X,Y,U,V) computes the curl z component and
angular velocity perpendicular to z (in radians per time unit)
of a 2D vector field U,V. The arrays X,Y define the
coordinates for U,V and must be monotonic and 2D plaid (as if
produced by MESHGRID).
[CURLZ, CAV] = CURL(U,V) assumes
[X Y] = meshgrid(1:N, 1:M) where [M,N]=SIZE(U).
[CURLX, CURLY, CURLZ] = CURL(...) or
[CURLX, CURLY] = CURL(...) returns only the curl.
CAV = CURL(...) returns only the curl angular velocity.
Example 1:
load wind
cav = curl(x,y,z,u,v,w);
slice(x,y,z,cav,[90 134],[59],[0]); shading interp
daspect([1 1 1])
camlight
Example 2:
load wind
k = 4;
x = x(:,:,k); y = y(:,:,k); u = u(:,:,k); v = v(:,:,k);
cav = curl(x,y,u,v);
pcolor(x,y,cav); shading interp
hold on; quiver(x,y,u,v)
See also streamribbon, divergence.
Reference page in Help browser
doc curl
<coneplot> - 3D cone plot.
CONEPLOT 3D cone plot.
CONEPLOT(X,Y,Z,U,V,W,Cx,Cy,Cz) plots velocity vectors as cones
at the points (Cx,Cy,Cz) in vector field defined by U,V,W. The
arrays X,Y,Z define the coordinates for U,V,W and must be
monotonic and 3D plaid (as if produced by MESHGRID). CONEPLOT
automatically scales the cones to fit.
CONEPLOT(U,V,W,Cx,Cy,Cz) assumes [X Y Z] = meshgrid(1:N, 1:M, 1:P)
where [M,N,P]=SIZE(U).
CONEPLOT(...,S) automatically scales the cones to fit and then
stretches them by S. Use S=0 to plot the cones without the automatic
scaling.
CONEPLOT(...,COLOR) colors the cones using the array
COLOR. COLOR must be a 3D array and be the same size as U. This
option only works with cones and not quiver arrows.
CONEPLOT(...,'quiver') draws arrows instead of cones (see QUIVER3).
CONEPLOT(...,'method') specifies the interpolation method to use.
'method' can be 'linear', 'cubic', or 'nearest'. 'linear' is the
default (see INTERP3).
CONEPLOT(X,Y,Z,U,V,W, 'nointerp') does not interpolate the
positions of the cones into a volume. The cones are drawn at
positions defined by X,Y,Z and are oriented according to
U,V,W. Arrays X,Y,Z,U,V,W must all be the same size.
CONEPLOT(AX,...) plots into AX instead of GCA.
H = CONEPLOT(...) returns a PATCH handle in H.
Example:
load wind
vel = sqrt(u.*u + v.*v + w.*w);
p = patch(isosurface(x,y,z,vel, 40));
isonormals(x,y,z,vel, p)
set(p, 'FaceColor', 'red', 'EdgeColor', 'none');
[f verts] = reducepatch(isosurface(x,y,z,vel, 30), .2);
h=coneplot(x,y,z,u,v,w,verts(:,1),verts(:,2),verts(:,3),2);
set(h, 'FaceColor', 'blue', 'EdgeColor', 'none');
[cx cy cz] = meshgrid(linspace(71,134,10),linspace(18,59,10),3:4:15);
h2=coneplot(x,y,z,u,v,w,cx,cy,cz,v,2); %color by North/South velocity
set(h2, 'EdgeColor', 'none');
axis tight; box on
camproj p; camva(24); campos([185 2 102])
camlight left; lighting phong
See also streamline, stream3, stream2, isosurface, smooth3, subvolume,
reducevolume.
Reference page in Help browser
doc coneplot
<streamtube> - 3D stream tube.
STREAMTUBE 3D stream tube.
STREAMTUBE(X,Y,Z,U,V,W,STARTX,STARTY,STARTZ) draws stream
tubes from vector data U,V,W. The arrays X,Y,Z define the
coordinates for U,V,W and must be monotonic and 3D plaid (as if
produced by MESHGRID). STARTX, STARTY, and STARTZ define the
starting positions of the streamlines at the center of the
tubes. The width of the tubes is proportional to the
normalized divergence of the vector field. A vector of surface
handles (one per start point) is returned in H.
STREAMTUBE(U,V,W,STARTX,STARTY,STARTZ) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(U).
STREAMTUBE(VERTICES,X,Y,Z,DIVERGENCE) assumes precomputed
streamline vertices and divergence. VERTICES is cell array of
streamline vertices (as if produced by stream3). X,Y,Z, and
DIVERGENCE are 3D arrays
STREAMTUBE(VERTICES,DIVERGENCE) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where
[M,N,P] = SIZE(DIVERGENCE).
STREAMTUBE(VERTICES,WIDTH) uses the cell array of vectors
WIDTH for the width of the tubes. The size of each
corresponding element of VERTICES and WIDTH must be equal.
STREAMTUBE(VERTICES,WIDTH) uses the scalar WIDTH for the
width of all streamtubes.
STREAMTUBE(VERTICES) automatically selects width.
STREAMTUBE(...,[SCALE N]) scales width of the tube by SCALE.
The default is SCALE=1. When the streamtubes are created using
start points or divergence, SCALE=0 will suppress automatic
scaling. N is the number of points along the circumference of
the tube. The default is N=20.
STREAMTUBE(AX,...) plots into AX instead of GCA.
H = STREAMTUBE(...) returns a vector of handles (one per start
point) to SURFACE objects.
Example 1:
load wind
[sx sy sz] = meshgrid(80, 20:10:50, 0:5:15);
h=streamtube(x,y,z,u,v,w,sx,sy,sz);
axis tight
shading interp;
view(3);
camlight; lighting gouraud
Example 2:
load wind
[sx sy sz] = meshgrid(80, 20:10:50, 0:5:15);
verts = stream3(x,y,z,u,v,w,sx,sy,sz);
div = divergence(x,y,z,u,v,w);
h=streamtube(verts,x,y,z,div);
axis tight
shading interp;
view(3);
camlight; lighting gouraud
See also divergence, streamribbon, streamline, stream3.
Reference page in Help browser
doc streamtube
<streamribbon> - 3D stream ribbon.
STREAMRIBBON 3D stream ribbon.
STREAMRIBBON(X,Y,Z,U,V,W,STARTX,STARTY,STARTZ) draws stream
ribbons from vector data U,V,W. The arrays X,Y,Z define the
coordinates for U,V,W and must be monotonic and 3D plaid (as if
produced by MESHGRID). STARTX, STARTY, and STARTZ define the
starting positions of the streamlines at the center of the
ribbons. The twist of the ribbons is proportional to the
curl of the vector field. The width of the ribbons is
calculated automatically.
STREAMRIBBON(U,V,W,STARTX,STARTY,STARTZ) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(U).
STREAMRIBBON(VERTICES,X,Y,Z,CAV,SPEED) assumes precomputed
streamline vertices, curl angular velocity, and flow
speed. VERTICES is cell array of streamline vertices (as if
produced by stream3). X,Y,Z, CAV and SPEED are 3D arrays.
STREAMRIBBON(VERTICES,CAV,SPEED) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P] = SIZE(CAV).
STREAMRIBBON(VERTICES,TWISTANGLE) uses the cell array of
vectors TWISTANGLE for the twist of the ribbons (in
radians). The size of each corresponding element of VERTICES
and TWISTANGLE must be equal.
STREAMRIBBON(...,WIDTH) sets the width of the ribbons to be
WIDTH.
STREAMRIBBON(AX,...) plots into AX instead of GCA.
H = STREAMRIBBON(...) returns a vector of handles (one per
start point) to SURFACE objects.
Example 1:
load wind
[sx sy sz] = meshgrid(80, 20:10:50, 0:5:15);
daspect([1 1 1])
h=streamribbon(x,y,z,u,v,w,sx,sy,sz);
axis tight
shading interp;
view(3);
camlight; lighting gouraud
Example 2:
load wind
[sx sy sz] = meshgrid(80, 20:10:50, 0:5:15);
daspect([1 1 1])
verts = stream3(x,y,z,u,v,w,sx,sy,sz);
cav = curl(x,y,z,u,v,w);
spd = sqrt(u.^2 + v.^2 + w.^2);
h=streamribbon(verts,x,y,z,cav,spd);
axis tight
shading interp;
view(3);
camlight; lighting gouraud
Example 3:
t = 0:.15:15;
verts = {[cos(t)' sin(t)' (t/3)']};
twistangle = {cos(t)'};
daspect([1 1 1])
h=streamribbon(verts,twistangle);
axis tight
shading interp;
view(3);
camlight; lighting gouraud
Example 4:
xmin = -7; xmax = 7;
ymin = -7; ymax = 7;
zmin = -7; zmax = 7;
x = linspace(xmin,xmax,30);
y = linspace(ymin,ymax,20);
z = linspace(zmin,zmax,20);
[x y z] = meshgrid(x,y,z);
u = y; v = -x; w = 0*x+1;
daspect([1 1 1]);
[cx cy cz] = meshgrid(linspace(xmin,xmax,30),linspace(ymin,ymax,30),[-3 4]);
h2=coneplot(x,y,z,u,v,w,cx,cy,cz, 'q');
set(h2, 'color', 'k');
[sx sy sz] = meshgrid([-1 0 1],[-1 0 1],-6);
p = streamribbon(x,y,z,u,v,w,sx,sy,sz);
[sx sy sz] = meshgrid([1:6],[0],-6);
p2 = streamribbon(x,y,z,u,v,w,sx,sy,sz);
shading interp
view(-30,10) ; axis off tight
camproj p; camva(66); camlookat; camdolly(0,0,.5,'f')
camlight
See also curl, streamtube, streamline, stream3.
Reference page in Help browser
doc streamribbon
<streamslice> - Streamlines in slice planes.
STREAMSLICE Streamlines in slice planes.
STREAMSLICE(X,Y,Z,U,V,W,Sx,Sy,Sz) draws well spaced streamlines
(with direction arrows) from vector data U,V,W in axis aligned
x,y,z planes at the points in the vectors Sx,Sy,Sz. The arrays
X,Y,Z define the coordinates for U,V,W and must be monotonic
and 3D plaid (as if produced by MESHGRID). V must be an
M-by-N-by-P volume array. It should not be assumed that the
flow is parallel to the slice plane; for example, in a
streamslice at a constant z, the z component of the vector
field, W, is ignored when calculating the streamlines for that
plane. Streamslices are useful for determining where to start
streamlines, streamtubes, and streamribbons.
STREAMSLICE(U,V,W,Sx,Sy,Sz) assumes
[X Y Z] = meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(V).
STREAMSLICE(X,Y,U,V) draws well spaced streamlines (with
direction arrows) from vector data U,V. The arrays X,Y define
the coordinates for U,V and must be monotonic and 2-D plaid (as
if produced by MESHGRID).
STREAMSLICE(U,V) assumes
[X Y] = meshgrid(1:N, 1:M) where [M,N]=SIZE(V).
STREAMSLICE(..., DENSITY) modifies the automatic spacing of the
streamlines. DENSITY must be greater than 0. The default value
is 1; higher values will produce more streamlines on each
plane. For example, 2 will produce approximately twice as many
streamlines while 0.5 will produce approximately half as many.
STREAMSLICE(...,'arrows'), (the default) draws direction
arrows. STREAMSLICE(...,'noarrows') suppresses drawing the
direction arrows.
STREAMSLICE(...,'method') specifies the interpolation method to
use. 'method' can be 'linear', 'cubic', or 'nearest'. 'linear'
is the default (see INTERP3).
STREAMSLICE(AX,...) plots into AX instead of GCA.
H = STREAMSLICE(...) returns a vector of handles to LINE
objects.
[VERTICES ARROWVERTICES] = STREAMSLICE(...) returns 2 cell
arrays of vertices for drawing the streamlines and the
arrows. These can be passed to any streamline drawing function
(streamline) to draw the plot.
Example 1:
load wind
streamslice(x,y,z,u,v,w,[],[],[5]);
Example 2:
load wind
[verts averts] = streamslice(u,v,w,10,10,10);
streamline([verts averts]);
spd = sqrt(u.*u + v.*v + w.*w);
hold on; slice(spd,10,10,10);
colormap(hot)
shading interp
view(30,50); axis(volumebounds(spd));
camlight; material([.5 1 0])
Example 3:
z = peaks;
surf(z); hold on
shading interp;
[c ch] = contour3(z,20); set(ch, 'edgecolor', 'b')
[u v] = gradient(z);
h = streamslice(-u,-v); % downhill
set(h, 'color', 'k')
for i=1:length(h);
zi = interp2(z,get(h(i), 'xdata'), get(h(i),'ydata'));
set(h(i),'zdata', zi);
end
view(30,50); axis tight
See also streamline, slice, contourslice.
Reference page in Help browser
doc streamslice
<streamparticles> - Display stream particles.
STREAMPARTICLES Display stream particles.
STREAMPARTICLES(VERTICES) draws stream particles of a vector
field. Stream particles are usually represented by markers and
can show the position and velocity of a streamline. VERTICES
is a cell array of 2D or 3D vertices (as if produced by STREAM2
or STREAM3).
STREAMPARTICLES(VERTICES, N) uses N to determine how many
stream particles are drawn. The 'ParticleAlignment' property
controls how N is interpreted. If 'ParticleAlignment' is 'off'
(the default) and N is greater than 1, then approximately N
particles are drawn evenly spaced over the streamline vertices;
if N is less than or equal to 1, N is interpreted as a fraction
of the original stream vertices; for example, if N is 0.2,
approximately 20% of the vertices will be used. N determines
the upper bound for the number of particles drawn. Note that
the actual number of particles may deviate from N by as much
as a factor of 2. If 'ParticleAlignment' is 'on', N determines
the number of particles on the streamline with the most
vertices; the spacing on the other streamlines is set to this
value. The default value is N=1.
STREAMPARTICLES(...,'NAME1',VALUE1,'NAME2',VALUE2,...) controls
the stream particles by using named properties and specified
values. Any unspecified properties have default values. Case
is ignored for property names.
STREAMPARTICLES PROPERTIES
Animate - Stream particles motion [ non-negative integer ]
The number of times to animate the stream particles. The
default is 0 which does not animate. Inf will animate until
ctrl-c is hit.
FrameRate - Animation frames per second [ non-negative integer ]
The number of frames per second for the animation. Inf, the
default will draw the animation as fast as possible. Note: the
framerate can not speed up an animation.
ParticleAlignment - Align particles with streamlines [ on | {off} ]
Set this property to 'on' to force particles to be drawn at the
beginning of the streamlines. This property controls how N is