Calculator result and MATLAB result are different

1 回表示 (過去 30 日間)
Irem ERSIN
Irem ERSIN 2022 年 1 月 9 日
編集済み: John D'Errico 2022 年 1 月 9 日
%% Question 1 - Step 1
CBT = [cos(24) -sin(24) 0 779 ; sin(24) cos(24) 0 599 ; 0 0 1 0 ; 0 0 0 1] % The definition of frame {C} in {B}
CP = [100 ; 100 ; 0 ; 1]; % Given position
BP = CBT*CP % Position of P in frame {B}

採用された回答

Irem ERSIN
Irem ERSIN 2022 年 1 月 9 日
I understood the problem. When calculating on MATLAB, the angles are in radians, so I need to convert to degree.

その他の回答 (1 件)

Alan Stevens
Alan Stevens 2022 年 1 月 9 日
Have you checked that both are using degrees, or both radians? The Matlab as you've written it is using radians (use sind(24) and cosd(24) if the 24 is in degrees).
  1 件のコメント
John D'Errico
John D'Errico 2022 年 1 月 9 日
編集済み: John D'Errico 2022 年 1 月 9 日
+1. And it would be rather surprising to me if one truly intended to compute the sin(24), where the 24 was in RADIANS. 24 radians is a relatively large number of radians, and an integer stongly suggests degrees were intended.

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

Community Treasure Hunt

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

Start Hunting!

Translated by