Plotting 9 single vectors

2 vues (au cours des 30 derniers jours)
Patrick
Patrick le 28 Fév 2015
Réponse apportée : Patrick le 28 Fév 2015
Hey everyone,
this is my first question so please be gentle. :)
I want to create a plot with MATLAB (2014b) that consists of nine single vectors. It should be a 3x3 field, so three stacks of three vectors. Sort of like this:
With every dot representing the location of a vector. I have the x and y components of those vectors at hand.
What I want to do in the end is since I have time resolved data for x and y for each of these vectors: I want to create a video of those 9 vectors changing over time. I've created videos in MATLAB before, thats not the problem, I can do that with loops and all that. The problem really just is the plot.
How can I create such a plot with having the x/y data for those individual vectors at hand?
Thanks a lot! :) Greetings from Germany!

Réponse acceptée

Patrick
Patrick le 28 Fév 2015
Hey myself,
I just found out what you/I need to know:
Try this:
[x,y] = meshgrid(1:1:3,1:1:3)
v=y*0+1
u=x*0+1
quiver(x,y,u,v)
That should give you/me your/mine 9 vectors. I/you only have to adjust u and v by the corresponding value instead of 1 then!
;)

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by