I want to draw an arrow in vector.

조회 수: 109 (최근 30일)
Muhendisleksi
Muhendisleksi 2017년 10월 9일
답변: Matevz Lavtar 2020년 11월 14일
Q = [0,977 -0,016
-0,016 0,176];
p1 = [0.977 -0.016]; %Coordinate of the first point
p2 =[-0.016 0.176]; % Coordinate of the second point
The start and end points of the arrow are as above. How can I draw a vector arrow with these points?

답변 (5개)

Matevz Lavtar
Matevz Lavtar 2020년 11월 14일
I have the same problem, so I make a function that solve this problem I think.
Example what can you do with it:
Hope it helps you

Jan
Jan 2017년 10월 9일
  댓글 수: 2
Muhendisleksi
Muhendisleksi 2017년 10월 9일
I checked all of them. But I could not find what I wanted.
Jan
Jan 2017년 10월 9일
편집: Jan 2017년 10월 9일
If you explain exactly, what you want, it is possible for the readers to give any specific suggestions. The information, that the dozens of existing implementations do not satisfy your needs, does not allow for further help.

댓글을 달려면 로그인하십시오.


Star Strider
Star Strider 2017년 10월 9일
편집: Star Strider 2017년 10월 9일
One option is the quiver plot:
Q = [0.977 -0.016
-0.016 0.176];
QX = Q(:,1); % Isolate Line ‘x’ Coordinates
QY = Q(:,2); % Isolate Line ‘y’ Coordinates
[~,UV] = gradient(Q); % Generate Gradient
UVX = [UV(1,1); 0]; % Define Quiver Arrow ‘x’
UVY = [UV(1,2); 0]; % Define Quiver Arrow ‘y’
figure(1)
% plot(QX, QY, '-r', 'LineWidth',1.2) % Plot Line (Optional)
hold on
quiver(QX, QY, UVX, UVY, 0)
hold off
axis([-0.15 1.1 -0.15 0.2])
axis equal
grid
EDIT Added axis calls to the plot.

Martin Meiringer
Martin Meiringer 2017년 12월 12일
Is there a reason why this functionality is still not built in? Using file exchange functions is always a bit difficult if you are sharing your work with colleagues. so please, Mathworks do a arrow / arrow3 function!!!
  댓글 수: 2
Star Strider
Star Strider 2017년 12월 12일
Submit an Enhandement Request at Contact Us (link).
MrKnudsen
MrKnudsen 2020년 4월 29일
Will my proposal further down work for you?

댓글을 달려면 로그인하십시오.


MrKnudsen
MrKnudsen 2020년 4월 29일
I think this hack might be useful:
figure()
hold on; grid on;
a1 = 1j+1;
a2 = -1;
a3 = -1j;
a4 = 0.5 -0.5j;
compass(a1,'r');
compass(a2,'g');
compass(a3,'b');
compass(a4,'y');

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by