Quiver vector length difficulty

9 visualizzazioni (ultimi 30 giorni)
David Arnold
David Arnold il 20 Gen 2018
Risposto: Star Strider il 20 Gen 2018
I've written this:
[T,Y]=meshgrid(-4:0.5:4,-4:0.5:4);
S=-(2-Y).*Y;
L=sqrt(1+S.^2);
quiver(T,Y,1./L,S./L)
axis tight
shg
And all the arrows are the same length. But when I try this:
t=linspace(-2,2,16);
y=linspace(-4,4,16);
[T,Y]=meshgrid(t,y);
S=Y./T+3*T;
L=sqrt(1+S.^2);
quiver(T,Y,1./L,S./L,0.5)
axis tight
The arrows are not all the same length. Am I doing something wrong or are there suggestions? I am using Matlab R2017b.
Thanks

Risposte (1)

Star Strider
Star Strider il 20 Gen 2018
Specifying 0.5 as the scale factor simply halves their lengths. it does not remove scaling. If you want them not scaled, use 0 for the scaling factor. (I do not know what effect that would have in your plot, because it apparently requires that you interact with the GUI to adjust their lengths afterwards.)
See the documentation for quiver (link) and Quiver Properties (link) for details.

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by