Compute 3-D streamline data
XYZ = stream3(X,Y,Z,U,V,W,startx,starty,startz)
XYZ = stream3(U,V,W,startx,starty,startz)
XYZ = stream3(...,options)
The arrays X, Y, and Z, which define the coordinates for U, V, and W, must be monotonic, but do not need to be uniformly spaced. X, Y, and Z must have the same number of elements, as if produced by meshgrid.
startx, starty, and startz define the starting positions of the streamlines. The section "Specifying Starting Points for Stream Plots" provides more information on defining starting points.
The returned value XYZ contains a cell array of vertex arrays.
XYZ = stream3(...,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:
If you do not specify values, MATLAB® software uses the default:
Step size = 0.1 (one tenth of a cell)
Maximum number of vertices = 10000
Use the streamline command to plot the data returned by stream3.
This example draws 3-D streamlines from data representing air currents over regions of North America.
load wind [sx sy sz] = meshgrid(80,20:10:50,0:5:15); streamline(stream3(x,y,z,u,v,w,sx,sy,sz)) view(3)