MuPad / MATLAB中的索引[list]错误无效

时间:2016-02-26 15:27:49

标签: matlab plot mupad

我试图在MuPad中绘制以下管道

X := 0.4448-0.1423*cos(t*0.0013)+0.0236*sin(t*0.0013)+0.0180*cos(2*t*0.0013)-0.0818*sin(2*t*0.0013);
Y := -0.2619+0.1274*cos(t*0.001)+0.0828*sin(t*0.001)-0.0108*cos(2*t*0.001)+0.0707*sin(2*t*0.001);
Z := 0.2493+ 0.2703*cos(t*0.0009) + 0.1823*sin(t*0.0009) + 0.0349*cos(2*t*0.0009) + 0.0991*sin(2*t*0.0009);
plot(plot::Tube([X, Y, Z],0.1*cos(t),t=0..2*PI));

出现以下错误:

Error: The index is invalid. [list]
  Evaluating: plot

函数和系数在MATLAB中计算并在MuPad中复制粘贴,应该没问题。我的MATLAB版本是2015b,以下命令工作正常:

X := sin(t);
Y := cos(t);
Z := t;    
plot(plot::Tube([X,Y,Z],0.3*cos(t),t=0..2*PI))

更新

这也有效:

plot(plot::Tube([X, t, Z],0.2*cos(t),t=0..2*PI))

我也试图改变表示,它也没有用。

sx := t*0.0013:
sy := t*0.001:
sz := t*0.00088:
b := matrix([[0.4448,-0.1423,0.0236,0.0180,-0.0818],[-0.2619,0.1274,0.0828,-0.0108,0.0707],[0.2493,0.2703,0.1823,0.0349,0.0991]]):
a := matrix([[1,cos(sx),sin(sx),cos(2*sx),sin(2*sx)],[1,cos(sy),sin(sy),cos(2*sy),sin(2*sy)],[1,cos(sz),sin(sz),cos(2*sz),sin(2*sz)]]):
at := transpose(a):
Xn := b[1,1..5]*at[1..5,1];
Yn := b[2,1..5]*at[1..5,2];
Zn := b[3,1..5]*at[1..5,3];
plot(plot::Tube([Xn[1], Yn[1], Zn[t]],2*cos(t),t=0..2*PI))

0 个答案:

没有答案