Het guys, i attached a code here. The problem is that the very first 'R' matrix i have to get is a Identity Matrix. Unfortunately, i don't know what went wrong there is some mistake. Could anyone shed some light, what i did wrong?. Thanking you in advance.

답변 (1개)

James Tursa
James Tursa 2020년 5월 12일

1 개 추천

I get the identity matrix with your code:
>> phi = 0;
>> psi = 0;
>> theta = 0;
>> R=[cosd(phi).*cosd(psi)-sind(phi).*cosd(theta).*sind(psi) sind(phi).*cosd(psi)+cosd(phi).*cosd(theta).*sind(psi) sind(theta).*sind(psi)
-cosd(phi).*sind(psi)-sind(phi).*cosd(theta).*cosd(psi) -sind(phi).*sind(psi)+cosd(phi).*cosd(theta).*cosd(psi) sind(theta).*cosd(psi)
sind(phi).*sind(theta) -cosd(phi).*sind(theta) cosd(theta)]
R =
1 0 0
0 1 0
0 0 1

댓글 수: 5

satish kumar
satish kumar 2020년 5월 13일
Thanks James for the response, yes for me also if i take independently my psi and theta values. But, i want to get that results by exactly passing through the for loop. i have to check for lots of variation in theta and psi values there I expect the first value of the 'R' as Identitymatrix which is not happening at now.
When,thetaV = (0:10:90); % euler angles for a rotation
psiV = (0:1:90); % euler angles for a rotation
and these going through for loop should get me Identity Matrix which i am not getting. Could you just see through this again. Thanks again James.
James Tursa
James Tursa 2020년 5월 13일
I copied your entire code and ran it in the debugger, pausing it at the first iteration. R is the identitiy matrix.
satish kumar
satish kumar 2020년 5월 13일
Really, james. I need one more help from you redarding the next part of this code. should i write here?
James Tursa
James Tursa 2020년 5월 13일
Sure.
satish kumar
satish kumar 2020년 5월 13일
Basically, i am expecting plots like screenshot(26).png which i am attaching here by running the code practice3.m . Could you just help me through.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2020년 5월 12일

댓글:

2020년 5월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by