如何获得符号系统的数值?

时间:2020-04-21 14:35:02

标签: matlab numeric symbolic-math

如何计算rollpitchyaw?我们需要找到符号变量rollpitchyaw的数值。

syms roll pitch yaw
C1i=[cos(yaw) sin(yaw) 0;
    -sin(yaw) cos(yaw) 0;
    0 0 1];

C21=[cos(pitch) 0 -sin(pitch);
    0        1    0;
     sin(pitch) 0 cos(pitch)];

 Cb2=[1   0     0;
     0   cos(roll) sin(roll);
    0   -sin(roll) cos(roll)];

Cequivalent = Cb2*C21*C1i

R = [ 0.8748 -0.4636 0.1410; 0.4779 0.8735 -0.0933; -0.0799 0.1490 0.9856];
R == Cequivalent

1 个答案:

答案 0 :(得分:3)

您可以为变量求解方程组:

res = solve( vpa(R) == Cequivalent, roll, pitch, yaw);

但是,没有解决方案,所以我想你在某个地方犯了一个错误。

结果将采用可变精度算术(VPA),并且可以转换为double:

res = double(res);