Özgür Kurt
Özgür Kurt

Reputation: 11

How can I get numerical values of a symbolic system?

How can I calculate roll, pitch, yaw ? We need to find the numerical values of the symbolic variables roll, pitch, yaw.

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

Upvotes: 1

Views: 143

Answers (1)

Robert Seifert
Robert Seifert

Reputation: 25232

You can just solve the equation system for your variables:

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

However, there is no solution, so I suppose you made a mistake somewhere.

The result will be in variable precision arithmetic (VPA) and can be converted to double:

res = double(res);

Upvotes: 3

Related Questions