MATLAB Function Reference Previous page   Next Page
streamline

Draw streamlines from 2-D or 3-D vector data

Syntax

Description

streamline(X,Y,Z,U,V,W,startx,starty,startz) draws streamlines from 3-D vector data U, V, W. The arrays X, Y, Z define the coordinates for U, V, W and must be monotonic and 3-D plaid (such as the data produced by meshgrid). startx, starty, startz define the starting positions of the streamlines. The section "Specifying Starting Points for Stream Plots provides more information on defining starting points.

streamline(U,V,W,startx,starty,startz) assumes the arrays X, Y, and Z are defined as [X,Y,Z] = meshgrid(1:N,1:M,1:P) where [M,N,P] = size(U).

streamline(XYZ) assumes XYZ is a precomputed cell array of vertex arrays (as produced by stream3).

streamline(X,Y,U,V,startx,starty) draws streamlines from 2-D vector data U, V. The arrays X, Y define the coordinates for U, V and must be monotonic and 2-D plaid (such as the data produced by meshgrid). startx and starty define the starting positions of the streamlines. The output argument h contains a vector of line handles, one handle for each streamline.

streamline(U,V,startx,starty) assumes the arrays X and Y are defined as [X,Y] = meshgrid(1:N,1:M) where [M,N] = size(U).

streamline(XY) assumes XY is a precomputed cell array of vertex arrays (as produced by stream2).

streamline(...,options) specifies the options used when creating the streamlines. Define options as a one- or two-element vector containing the step size or the step size and the maximum number of vertices in a streamline:

or

If you do not specify values, MATLAB uses the default:

streamline(axes_handles,...) plots into the axes object with handle axes_handle instead of the current axes object (gca).

h = streamline(...) returns a vector of line handles, one handle for each streamline.

Examples

This example draws streamlines from data representing air currents over a region of North America. Loading the wind data set creates the variables x, y, z, u, v, and w in the MATLAB workspace.

The plane of streamlines indicates the flow of air from the west to the east (the x-direction) beginning at x = 80 (which is close to the minimum value of the x coordinates). The y- and z-coordinate starting points are multivalued and approximately span the range of these coordinates. meshgrid generates the starting positions of the streamlines.

See Also

coneplot, stream2, stream3, streamparticles

Volume Visualization for related functions

Specifying Starting Points for Stream Plots for related information

Stream Line Plots of Vector Data for another example


Previous page  stream3 streamparticles Next page

© 1994-2005 The MathWorks, Inc.