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

问题描述 投票:1回答:1

如何计算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
matlab numeric symbolic-math
1个回答
1
投票

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

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

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

结果将以可变精度算术(VPA)并将其转换为double:

res = double(res);
© www.soinside.com 2019 - 2024. All rights reserved.