12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

stream2Purpose2stream2Compute 2-D stream line dataSyntaxDescriptionXY = stream2(x,y,u,v,startx,starty)XY = stream2(u,v,startx,starty)XY = stream2(...,options)XY = stream2(x,y,u,v,startx,starty) computes stream lines from vectordata u and v. The arrays x and y define the coordinates for u and v and must bemonotonic and 2-D plaid (such as the data produced by meshgrid). startx andstarty define the starting positions of the stream lines. The returned value XYcontains a cell array of vertex arrays.XY = stream2(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).XY = stream2(...,options) specifies the options used when creating thestream lines. Define options as a one or two element vector containing the stepsize or the step size and the maximum number of vertices in a stream line:[stepsize]or[stepsize, max_number_vertices]If you do not specify a value, <strong>MATLAB</strong> uses the default:• stepsize = 0.1 (one tenth of a cell)• naximum number of vertices = 1000Use the streamline command to plot the data returned by stream2.ExamplesThis example draws 2-D stream lines from data representing air currents overregions of North America.load wind[sx,sy] = meshgrid(80,20:10:50);streamline(stream2(x(:,:,5),y(:,:,5),u(:,:,5),v(:,:,5),sx,sy));See Alsoconeplot, isosurface, reducevolume smooth3, stream3, streamline,subvolume2-460

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!