streamparticles
Plot stream particles
Syntax
streamparticles(vertices)
streamparticles(vertices,n)
streamparticles(...,'PropertyName
',PropertyValue,...)
streamparticles(ax,...)
streamparticles(line_handle,...)
h = streamparticles(...)
Description
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 2-D or
3-D vertices (as if produced by stream2
or stream3
).
streamparticles(vertices,n)
uses n
to determine how many stream particles to
draw. The ParticleAlignment
property controls how n
is
interpreted.
If
ParticleAlignment
is set tooff
(the default) andn
is greater than1
, approximatelyn
particles are drawn evenly spaced over the streamline vertices.If
n
is less than or equal to1
,n
is interpreted as a fraction of the original stream vertices; for example, ifn
is0.2
, approximately 20% of the vertices are used.n
determines the upper bound for the number of particles drawn. The actual number of particles can deviate fromn
by as much as a factor of 2.If
ParticleAlignment
ison
,n
determines the number of particles on the streamline having the most vertices and sets the spacing on the other streamlines to this value. The default value isn = 1
.
streamparticles(...,'
controls the stream particles using named properties and specified
values. Any unspecified properties have default values. MATLAB® ignores
the case of property names.PropertyName
',PropertyValue,...)
streamparticles(ax,...)
creates the stream
particles in the axes specified by ax
instead of
in the current axes (gca
). The option ax
can
precede any of the input argument combinations in the previous syntaxes.
Stream Particle Properties
Animate
— Stream particle motion [nonnegative
integer]
The number of times to animate the stream particles. The default is 0
,
which does not animate. Inf
animates until you enter Ctrl+C.
FrameRate
— Animation frames per second
[nonnegative integer]
This property specifies the number of frames per second for the animation.
Inf
, the default, draws the animation as fast as possible.
Note that the speed of the animation might be limited by the speed of the computer.
In such cases, the value of FrameRate
cannot necessarily be
achieved.
ParticleAlignment
— Align particles
with streamlines [ on
| {off}
]
Set this property to on
to draw particles
at the beginning of each streamline. This property controls how streamparticles
interprets
the argument n
(number of stream particles).
Stream particles are primitive line objects. In addition to
stream particle properties, you can specify any line property, such
as Marker
. streamparticles
sets
the following line properties when called.
Line Property | Value Set by streamparticles |
---|---|
LineStyle | 'none' |
Marker | 'o' |
MarkerEdgeColor | 'none' |
MarkerFaceColor | 'red' |
You can override any of these properties by specifying a property
name and value as arguments to streamparticles
.
For example, this statement uses RGB values to set the MarkerFaceColor
to
medium gray:
streamparticles(vertices,'MarkerFaceColor',[.5 .5 .5])
streamparticles(line_handle,...)
uses the line object identified by line_handle
to
draw the stream particles.
h = streamparticles(...)
returns a vector of handles to the primitive line objects it creates.
For a list of properties, see Line Properties.
Examples
Extended Capabilities
Version History
Introduced before R2006a