2016-05-11 37 views
1

Matlabの連続性を示すために、線の終わりに矢印付き水平線を持つグラフをプロットしようとしていますが、これはどのように可能ですか?参照用矢印付きのMatlab水平線プロット

画像:http://i.stack.imgur.com/IYCh3.jpg

+2

[ 'annotation'](のhttp:/ /www.mathworks.com/help/matlab/ref/annotation.html) – excaza

+1

これには['quiver'](http://de.mathworks.com/help/matlab/ref/quiver.html)を使うことができますアプローチ。 – incBrain

答えて

1
p1 = [2 3];       % First Point 
p2 = [9 3];       % Second Point 
dp = p2-p1;       % Difference 
figure(1) 
quiver(p1(1),p1(2),dp(1),dp(2),0) 
grid 
axis([0 10 0 10]) 
text(p1(1),p1(2), sprintf('(%.0f,%.0f)',p1)) 
text(p2(1),p2(2), sprintf('(%.0f,%.0f)',p2)) 

あなたも、あなたの姿のための白い背景を取得するには、グリッドコマンドーとテキストコマンドーを削除することができます。

p1 = [2 3];       % First Point 
p2 = [9 3];       % Second Point 
dp = p2-p1;       % Difference 
figure(1) 
quiver(p1(1),p1(2),dp(1),dp(2)) 
axis([0 10 0 10]) 
関連する問題