Why does the QUIVER command in MATLAB display the wrong vector length?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Bearbeitet: MathWorks Support Team
am 17 Nov. 2021
When I execute the following code in MATLAB:
quiver(0,0,3,0);
the resulting plot does not display an arrow from (0,0) to (3,0).
Akzeptierte Antwort
MathWorks Support Team
am 15 Nov. 2021
Bearbeitet: MathWorks Support Team
am 17 Nov. 2021
This enhancement has been incorporated in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
The QUIVER function in MATLAB autoscales vectors it draws, as described in the documentation.
As this indicates, you can obtain correct lengths by using a fifth argument, a scaling parameter. The following code displays the expected arrow from (0,0) to (3,0):
quiver(0,0,3,0,0);
quiver(0,0,3,0,'AutoScale','off')
Alternatively, one of the following three commands will work:
quiver(0,0,3,0,1);
quiver(0,0,3,0,'AutoScaleFactor',1)
The latter 2 are autoscaled and a scaling factor of 1 is applied.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Vector Fields finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!