Question about velocity graphs with quiver3

4 次查看(过去 30 天)
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

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by