How do I solve a matrix for it's variables?
이전 댓글 표시
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?
답변 (2개)
Roger Stafford
2016년 5월 23일
편집: Roger Stafford
2016년 5월 23일
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
Katrine Rav
2016년 5월 24일
Walter Roberson
2016년 5월 24일
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.
카테고리
도움말 센터 및 File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!