2013-06-11 357 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