mangguotang 2021-08-20 21:40 采纳率: 0%
浏览 31

matlab带未知数矩阵,出现乱码。。目标是:可以对带未知数的矩阵进行点乘,提取第四列的1,2,3行元素画图


T01 =

    0.9470   -0.1061    0.3033   42.9549
   -0.1061    0.7879    0.6066   85.9097
   -0.3033   -0.6066    0.7348  245.6853
         0            0             0           1.0000
l=270
theta2 =1.0998
phi2 =-0.8417


function zhuanyijuzhen_2(T01,phi,theta,l)
syms t;

A=[(cos(phi))^2*cos(t)+(sin(phi))^2,cos(phi)*sin(phi)*cos(t)-cos(phi)*sin(phi),cos(phi)*sin(t),l/theta*cos(phi)*(1-cos(t));
    cos(phi)*sin(phi)*cos(t)-cos(phi)*sin(phi),(sin(phi))^2*cos(t)+(cos(phi))^2,sin(phi)*sin(t),l/theta*sin(phi)*(1-cos(t));
    -cos(phi)*sin(t),-sin(theta)*sin(phi),cos(theta),l/theta*sin(t);
    0,0,0,1];

T=T01.*A;
% t=[0:0.1:theta2];

x=T(1,4);
y=T(2,4);
z=T(3,4);

p=plot3(x,y,z)
p.LineWidth =5;
hold on

end

img

  • 写回答

1条回答 默认 最新

  • joel_1993 2021-08-21 00:39
    关注

    函数里面试一试这样处理:

    t0=[0:0.1:theta2];
    x=eval(subs(T(1,4),t,t0));
    y=eval(subs(T(2,4),t,t0));
    z=eval(subs(T(3,4),t,t0));
    
    评论

报告相同问题?

问题事件

  • 创建了问题 8月20日