Plotting 9 single vectors

1 view (last 30 days)
Patrick
Patrick on 28 Feb 2015
Answered: Patrick on 28 Feb 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!

Accepted Answer

Patrick
Patrick on 28 Feb 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!
;)

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!