Clear Filters
Clear Filters

How to set density of streamslice?

5 views (last 30 days)
The streamslice document says I can change density of the plot.
However I cannot find proper way to set density of the plot when using below syntax.
Is there a order when using below 3 syntaxes?
If so, how do I know the correct order with document?
% works
[X,Y]=meshgrid(0:10);
U=X.^2+Y.^2;
V=X+Y;
streamslice(X,Y,U,V,2,'arrow','cubic');
% not works (Added parameters in order stated in document)
[X,Y]=meshgrid(0:10);
U=X.^2+Y.^2;
V=X+Y;
streamslice(X,Y,U,V,'arrow',2,'cubic');
Error using streamslice
Volume data arguments must be 3-D arrays.

Accepted Answer

Angelo Yeo
Angelo Yeo on 24 Mar 2024
Good question! I believe it's worth it to update the doc. Let me relay your request to doc writers. The correct order is
streamslice(X, Y, U, V, density, 'arrowsmode', 'method')
You can get helped with the "tips" from MATLAB editor like below. (Below is from R2024a)
You can also see the correct order of input arguments according to the order of descriptions of them in the doc. Does this make sense to you?

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!