How to set density of streamslice?

5 次查看(过去 30 天)
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.

采纳的回答

Angelo Yeo
Angelo Yeo 2024-3-24
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?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by