input euler angles which outputs rotation matrix R

Hi , i have the euler angles ?, ?, ? which i want to input in a function which returns a rotation matrix R in matlab

 採用された回答

KSSV
KSSV 2018 年 9 月 27 日

1 投票

function R = RotationMatrix(phi,theta,psi)
p = phi ;
t = theta ;
s = psi ;
D = [cos(p) sin(p) 0 ; -sin(p) cos(p) 0 ; 0 0 1] ;
C = [1 0 0 ; 0 cos(t) sin(t) ; 0 -sin(t) cos(t)] ;
B = [cos(s) sin(s) 0 ; -sin(s) cos(s) 0 ; 0 0 1] ;
R = B*C*D ;
end

2 件のコメント

KSSV
KSSV 2018 年 9 月 27 日
Fredrik Tveita commented: Thank you so much.
KSSV
KSSV 2018 年 9 月 27 日
Thanks is accepting and voting the answer..:)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

質問済み:

2018 年 9 月 27 日

コメント済み:

2018 年 9 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by