Effacer les filtres
Effacer les filtres

Plotting vectors that connect

6 vues (au cours des 30 derniers jours)
Brennan Macklin
Brennan Macklin le 12 Avr 2016
Modifié(e) : Kirby Fears le 12 Avr 2016
I am trying to create a single figure in which I plot the vectors whose x, y points come from a matrix
V = [ 0 2.0840 -8.6160 -0.5878 2.3511; 12.0000 2.1580 21.3252 -0.8090 3.2361]
in such a manner that the beginning of the second vector is at the end of the first, etc. and the resultant force vector is made clear.
thank you in advance if you are able to help me.

Réponses (1)

Kirby Fears
Kirby Fears le 12 Avr 2016
Modifié(e) : Kirby Fears le 12 Avr 2016
Brennan,
Have you tried using quiver?
V = [0 2.0840 -8.6160 -0.5878 2.3511; 12.0000 2.1580 21.3252 -0.8090 3.2361]';
startPoints = cumsum(V);
startPoints = [0 0; startPoints(1:end-1,:)];
quiver(startPoints(:,1),startPoints(:,2),V(:,1),V(:,2),0);
The last argument to quiver (scale = 0) turns off auto-scaling of the vector lengths.
Hope this helps.

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by