MATLAB Function Reference    

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 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.

streamparticles(...,'PropertyName',PropertyValue,...) controls the stream particles using named properties and specified values. Any unspecified properties have default values. MATLAB ignores the case of property names.

Stream Particle Properties

Animate - Stream particle motion [non-negative 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 [non-negative 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 speed of the animation may be limited by the speed of the computer. In such cases, the value of FrameRate can not necessarily be achieved.

ParticleAlignment - Align particles with stream lines [ on | {off} ]

Set this property to on to draw particles at the beginning of each the stream line. This property controls how streamparticles interprets the argument n (number of stream particles).

Stream particles are line objects. In addition to stream particle properties, you can specify any line object property, such as Marker and EraseMode. streamparticles sets the following line properties when called.

Line Property
Value Set by streamparticles

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(line_handle,...) uses the line object identified by line_handle to draw the stream particles.

h = streamparticles(...) returns a vector of handles to the line objects it creates.


This example combines stream lines with stream particle animation. The interpstreamspeed function determines the vertices along the stream lines where stream particles will be drawn during the animation, thereby controlling the speed of the animation. Setting the axes DrawMode property to fast provides faster rendering.

The following picture is a static view of the animation.

This example uses the stream lines in the z = 5 plane to animate the flow along these lines with steamparticles.

See Also

interpstreamspeed, stream3, streamline

Volume Visualization for related functions

Creating Stream Particle Animations for more details

Specifying Starting Points for Stream Plots for related information

  streamline streamribbon