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 CenterFile Exchange에서 2-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