Skip to content

stream2

plot · scripts/plot/draw/stream2.m

: xy = stream2 (x, y, u, v, sx, sy)
: xy = stream2 (u, v, sx, sy)
: xy = stream2 (…, options)

Compute two-dimensional streamline vertices of a vector field.

u and v are the components on the grid given by the vectors (or matrices) x and y; without them the grid is 1:columns by 1:rows. A line is traced from every seed point (sx, sy) forward and backward through the bilinearly interpolated field. options is step or [step maxverts]: the step length in units of a grid cell (default 0.1) and the largest number of vertices of a line (default 10000). A line stops where it leaves the grid or where the field vanishes.

The result is a cell array with one p-by-2 matrix of vertices per seed; it is empty for a seed outside the grid.