How do I solve a matrix for it's variables?
Afficher commentaires plus anciens
I defined this matrix
function [euler]=eu(z,y,x)
[euler]=[cosd(z)*cosd(y) cosd(z)*sind(y)*sind(x)-sind(z)*cosd(x) cosd(z)*sind(y)*cosd(x)+sind(z)*sind(x); sind(z)*cosd(y) sind(z)*sind(y)*sind(x)+cosd(z)*cosd(x) sind(z)*sind(y)*cosd(x)-cosd(z)*sind(x); -sind(y) cosd(y)*sind(x) cosd(y)*cos(x)]
end
I wish to calculate z, y, x when euler=[0,0,-1;0,-1,0;-1,0,0].
I tried
>> solve(eu(z,y,x)==[0,0,-1;0,-1,0;-1,0,0])
What command should I use?
Réponses (2)
Roger Stafford
le 23 Mai 2016
Modifié(e) : Roger Stafford
le 23 Mai 2016
You cannot determine x, y, and z uniquely from your given value of 'euler'. For this value they all reduce to three simple equalities:
cosd(x-z) = -1
sind(x-z) = 0
sind(y) = 1
from which you can only conclude that y is equal to 90 plus or minus some multiple of 360, and that x and z differ by 180 plus or minus some multiple of 360.
2 commentaires
Katrine Rav
le 24 Mai 2016
Walter Roberson
le 24 Mai 2016
9 nonlinear equations in 3 unknowns seldom has a solution, especially since you are using floating point arithmetic to define the values.
But more of a problem is that you are trying to find the unique Euler angles that will bring about a particular 3D rotation. There are always at least two sets of angles that bring about the same 3D rotation.
Katrine Rav
le 24 Mai 2016
0 votes
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!