检查时发现上述程序输入时有点小错误:L,改后为:
syms theta1 theta2 theta3 d2;
a=[cos(theta1) -sin(theta1)*cosd(78) sin(theta1)*sind(78) 100*cos(theta1);sin(theta1) cos(theta1)*cosd(78) -cos(theta1)*sind(78) 100*sin(theta1);0 sind(78) cosd(78) 0;0 0 0 1];
b=[cos(theta2) -sin(theta2)*cosd(-45) sin(theta2)*sind(-45) 10*cos(theta2);sin(theta2) cos(theta2)*cosd(-45) -cos(theta2)*sind(-45) 10*sin(theta2);0 sind(-45) cosd(-45) d2;0 0 0 1];
c=[cos(theta3) -sin(theta3)*cosd(97) sin(theta3)*sind(97) 150*cos(theta3);sin(theta3) cos(theta3)*cosd(97) -cos(theta3)*sind(97) 150*sin(theta3);0 sind(97) cosd(97) 180;0 0 0 1];
P=[0 0 1;0 0 0;40 1 0;1 0 0];
A=a*b*c;
R=A*P;
H=R-[260.188 -9.83535 98.7370;-0.225849 0.390972 0.892263;0.163272 -0.88778 0.430335;1 0 0];
[theta1,theta2,theta3,d2]=solve(H(1,1),H(3,1),H(3,2),H(3,3));
theta1=double(theta1)