streamparticles

Draws particles moving along streamlines.

Category: Graphics > 2-D and 3-D Plots

Syntax

streamparticles(verts, n)

Draws n particles that travel along the lines in verts.

streamparticles(verts, n, Name, Value)

Sets options such as 'Animate'.

Description

Particles are markers placed along the streamlines and advanced step by step, which conveys the speed and direction of the flow. The input is the same vertex data used by streamline.

Input arguments

verts
Cell array of vertices from stream2 or stream3.
n
Number of particles.
'Animate'
Number of animation cycles. With 0 the particles are drawn once, without animation.

Example

Particles on two streamlines

[x, y] = meshgrid(-2:0.5:2);
u = -y;
v = x;
verts = stream2(x, y, u, v, [1 0.5], [0 0]);
streamline(verts)
streamparticles(verts, 5);

In the app, the figure is drawn below the code.

See also

streamline stream2 stream3