2013-06-11 722 views
2

我在matlab中有三維的軌跡信息。這些是某人正在做出的姿態。當我使用plot3連接matlab中的點時,我可以很好地看到軌跡。 但是,軌跡是情節中的一條線,但我不知道手勢在哪個方向被製作,因爲時間不可視化。是否有可能在三維圖(尺寸爲x,y和z)中將其可視化?例如,開始時的顏色爲鮮紅色,末尾的顏色爲黑色。在matlab中繪製軌跡數據

感謝您的幫助,

埃克托

+0

喜歡的東西['coneplot'](http://www.mathworks.com/help/matlab/ref/coneplot.html )? – Doresoom

回答

4

您需要comet3劇情(如果你不介意的動畫)。

如果你介意動畫,而你正在尋找一個靜態圖,我會使用quiver

實施例:

% value of the parameter in the parametric equation 
t = 0:0.5:2*pi; 

% modified coordinate axes 
u = [1 0 0].'; 
v = [0 2 0].'; 

% coordinates of the ellipse 
Ell = bsxfun(@plus, bsxfun(@times, u, cos(t)), bsxfun(@times, v, sin(t))); 

% difference vectors between all data points will be used as "velocities" 
dEll = diff(Ell, 1,2); 

% Quiver the ellipse 
quiver3(... 
    Ell(1,1:end-1), Ell(2,1:end-1), Ell(3,1:end-1), ... 
    dEll(1,:), dEll(2,:), dEll(3,:), ... 
    2, 'r') % = scale, LineSpec 

axis tight equal 

結果:

enter image description here

+0

感謝您的迴應;我使用了箭頭和一些文檔查找工作:P您的示例中使用的語法對我來說完全是陌生的:) –

+0

@hector能否請你告訴我如何通過幀追蹤不同的點? – Tak