stream3

Computes 3-D streamline vertices of a vector field.

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

Syntax

verts = stream3(X, Y, Z, U, V, W, startx, starty, startz)

Traces a streamline from each starting point.

verts = stream3(U, V, W, startx, starty, startz)

Uses array indices as coordinates.

Description

This is the 3-D version of stream2. The vertices can be drawn with streamline, or used to build ribbons and tubes with streamribbon and streamtube.

Input arguments

X, Y, Z
Grid coordinates, such as from meshgrid.
U, V, W
Vector components at the grid points.
startx, starty, startz
Coordinates of the starting points.

Output arguments

verts
Cell array with one N-by-3 matrix of vertices for each starting point.

Example

A helical path

[x, y, z] = meshgrid(-2:1:2);
u = -y;
v = x;
w = 0*z + 0.1;
xyz = stream3(x, y, z, u, v, w, 1, 0, 0);
disp(class(xyz))
disp(size(xyz{1}, 2))
Output
cell
     3

See also

stream2 streamline streamribbon streamtube