| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
![]()
To graph selected variables, use the Plot Selector
in the Workspace Browser,
or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details,
see Plotting Tools
— Interactive Plotting in the MATLAB Graphics
documentation and Creating Graphics
from the Workspace Browser in the MATLAB Desktop Tools
documentation.
streamline(X,Y,Z,U,V,W,startx,starty,startz)
streamline(U,V,W,startx,starty,startz)
streamline(XYZ)
streamline(X,Y,U,V,startx,starty)
streamline(U,V,startx,starty)
streamline(XY)
streamline(...,options)
streamline(axes_handle,...)
h = streamline(...)
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:
[stepsize]
or
[stepsize, max_number_vertices]
If you do not specify values, MATLAB uses the default:
Step size = 0.1 (one tenth of a cell)
Maximum number of vertices = 1000
streamline(axes_handle,...) plots into the axes object with the handle axes_handle instead of the into current axes object (gca).
h = streamline(...) returns a vector of line handles, one handle for each streamline.
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.
load wind [sx,sy,sz] = meshgrid(80,20:10:50,0:5:15); h = streamline(x,y,z,u,v,w,sx,sy,sz); set(h,'Color','red') view(3)
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
![]() | stream3 | streamparticles | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |