2012-02-28 100 views
1

如何在3D Matlab繪圖中簡單地製作帶有標籤的弧線?我有兩個3D矢量(plot :: Arrow3d),我想命名它們之間的角度,我想在3D圖上顯示它。兩個3d矢量之間的弧線

EDIT1: 我使用MuPad呈現我的繪圖,我想是由曲線:: Arc3d繪製兩個向量之間的圓弧(1,[0,0,0],N,al..bet)。其中n很容易找到。但我完全不明白弧的角度從3D開始。 somobody能告訴我如何找到零角度嗎?

回答

0

簡短回答,請使用text函數。

看看這個讓你開始:

%A couple of random points in 3 space 
xyz1 = randn(3,1); 
xyz2 = randn(3,1); 

%Set up a figure, and create "arrow" plots within 
figure(3781); 
clf; 
hold on 
quiver3(0,0,0,xyz1(1), xyz1(2), xyz1(3),0,'b') 
quiver3(0,0,0,xyz2(1), xyz2(2), xyz2(3),0,'r') 
view(3) 

%Add a line connecting teh arrows, and a text label 
plot3([xyz1(1) xyz2(1)], [xyz1(2) xyz2(2)], [xyz1(3) xyz2(3)],'k:') 
xyzCenter = mean([xyz1 xyz2],2); 
h = text(xyzCenter(1), xyzCenter(2), xyzCenter(3), 'Label text here'); 
set(h,'Color','b') 
get(h); %For more properties to set 
+0

謝謝你,但它不能在MuPad工作。 Mb你知道在這裏怎麼做? – itun 2012-02-28 18:21:50

+0

對不起,我沒有使用過MuPad,今天我不能在stackoverflow的研究上花太多時間。祝你好運。 – Pursuit 2012-02-28 18:43:59