

Streamslice(x, y, z, u, v, w, 1.5, 1.5, -1.5) Ī couple of other vector field visualization tools to keep in mind are streamtube and streamribbon. Streamslice works very similarly to slice and allows you to cut a plane through the space and project the vector field onto it. Set(hhh2, 'FaceColor', 'r', 'EdgeColor', 'none') Zz = cellfun(fcn, zz, 'uniformoutput', false) Yy = cellfun(fcn, yy, 'uniformoutput', false) Xx = cellfun(fcn, xx, 'uniformoutput', false) % Get X/Y/Z data for the stream linesįcn = c(round(linspace(1, length(c), 5))) % index into 5 equally spaced points You can add velocity cones on top of the streamlines to indicate the velocity along the lines. Hhh = streamline(x, y, z, u, v, w, sx, sy, sz) The following shows a single streamline starting at point (-1, 1, -1.5) clf Streamline gives you information about a particular particle in space and describes how it moves through the vector field. In fact, coneplot has an option to display arrows instead of cones: delete(h)Ĭoneplot(x, y, z, u, v, w, cx, cy, cz, 'quiver') Set(h, 'FaceColor', 'r', 'EdgeColor', 'none') H = coneplot(x, y, z, u, v, w, cx, cy, cz, 5) This way, you can work with a high-resolution data without sacrificing graphics. coneplot allows you to specify locations of the vectors (in the form of cones). In such situations, there's a different function called coneplot that you can use. Print -dpng -r200 largeQuiver % save as PNG fileĪs you can see, there are too many arrows to make this a meaningful plot. W = -z % z-component of vector field % Using an invisible figure because this will choke most video cards For this reason, the visualization may not be very useful if you want a higher resolution: = meshgrid(-1.5:0.1:1.5) Quiver3 (and quiver) places a vector at each grid point. V = sin(4*x) - sin(2*y) % y-component of vector field U = x + cos(4*x) + 3 % x-component of vector field This method could be employed to round to other digits by altering the scale factor.In order to visualize vector fields, you can use the quiver3 function. After rounding, Data is divided by 10 to rescale it properly. The round function always rounds to the nearest whole number so by multiplying Data by 10 before rounding, the tenths digit is temporarily shifted to the ones digit. In this example, Data is rounded to the nearest tenths digit (0.26 would be rounded to 0.3) and stored in variable RoundedData.

You can round more precisely using an equation of the following form: In this example, a new variable named Data is rounded to the nearest whole number and stored in variable RoundedData. Alter > Specify Equations and enter the following equation:
