MATLAB: Plotting 9 single vectors

MATLABplotvectorvideo

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 3×3 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!

Best Answer

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!
;)
Related Question