Plotting 9 single vectors

3 ビュー (過去 30 日間)
Patrick
Patrick 2015 年 2 月 28 日
回答済み: Patrick 2015 年 2 月 28 日
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!

採用された回答

Patrick
Patrick 2015 年 2 月 28 日
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!
;)

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by