필터 지우기
필터 지우기

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 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