フィルターのクリア

Question about velocity graphs with quiver3

4 ビュー (過去 30 日間)
JP
JP 2013 年 6 月 24 日
コメント済み: Ashbub 2018 年 1 月 7 日
Hey, Im trying to use quiver3 to plot some vectors and it wont start at the right position! I dont want the vector to start at the origin, I want it to start at my data points and point TOWARDS the origin. Heres what I have...
figure(1)
quiver3(100,150,-500,0,0,0,'r')
xlim([-200 200]);
ylim([-200 200]);
zlim([-1000 0]);
drawnow
Now when I reverse the 0s so they are in the front, it works fine except for it points from the origin to my point. I want it the other way around! When I have the points first, nothing appears. Please help thanks!

採用された回答

JP
JP 2013 年 6 月 24 日
Ahh I actually just figured it out. I was being an idiot. For quiver3, it species the first three numbers are the point at which you want your vector, and the second three numbers are the vector you want drawn. For some reason I thought the length of the vector depended on the difference between the two sets of points, but that is not the case! So if you want a vector of [1;2;3] at point (2,3,5) you do
quiver3(2,3,5,1,2,3)
sorry, hope this helps if anyone makes the same dumb mistake I did
  1 件のコメント
Ashbub
Ashbub 2018 年 1 月 7 日
Hi, if I want to draw numerous vectors using quiver3(0,0,0,x(:),y(:),z(:)), where x, y and z stores the vector coordinates. Its giving error message
"Error in regionpropstrials (line 18) quiver3(0,0,0,x(:),y(:),z(:));"
Please suggest.

サインインしてコメントする。

その他の回答 (1 件)

David Sanchez
David Sanchez 2013 年 6 月 24 日
Did you read the help?
help quiver3
with your code, you are setting the velocities to 0, no doubt you do not get anything. The 4th, 5th and 6th elements have to be the velocities, if you set them to 0, nothing shows up.
This may be of help:
quiver3(100,150,-500,-100,-150,500)
hold on
plot3(100,150,-500,'*', 'MarkerSize',10)
plot3(0,0,0,'r*', 'MarkerSize',10)
hold off
  1 件のコメント
JP
JP 2013 年 6 月 24 日
Yes I answered my own question a while ago thanky anyways, sorry!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by