2012-02-28 94 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