How to plot vector from data
이전 댓글 표시
Hi,
I want to display 3D vectors. I got every channel in a different vector. Also Vec_X contains about 100 values and X is the axis. Vec_X(0) is the value that corresponds to X(0) Vec_X(n) to X(n).
And of course I also have Vec_Y and Y Vec_Z and Z.
What I want to do is display this as vectors. Plane XY, XZ, YZ and a 3D view of it. I started working with the matlab function quiver ( and quiver3 ). quiver(x,y,Vec_X,Vec_Y) but this doesn't work the way I want it to : It draws the vectors corresponding to the points (0,0) (1,1) (2,2) etc.. but (0,1) (0,2) etc are all missing.
Do you have an idea of what I could use ? The final objective is to find the point ( if it exists ) all these vectors are pointing at. So the graphic has to be readable.
Thanks for your help. If you have any question or if you don't understand what my objective is, I could paste some code lines :)
답변 (3개)
Sean de Wolski
2012년 5월 21일
Do you have a data point and corresponding vectors components for each of those (0,1), (0,2) etc.?
If you don't have points defined at these lcoations they won't be drawn and to get them you would have to interpolate.
More per comment/answers
doc meshgrid
use meshgrid to generate index matrices.
Julien RUNTZ
2012년 5월 21일
0 개 추천
댓글 수: 3
Sean de Wolski
2012년 5월 21일
NONONO! Why make life hard for yourself?
doc meshgrid %!!
Walter Roberson
2012년 5월 21일
Or to make your life even easier on yourself, ndgrid() instead of meshgrid()
Sean de Wolski
2012년 5월 21일
very true.
카테고리
도움말 센터 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!