My matlab somehow in degree mode

6 ビュー (過去 30 日間)
Qianliang
Qianliang 2014 年 9 月 22 日
コメント済み: Star Strider 2014 年 9 月 22 日
I was trying to write some codes for signal processing. Somehow my sin,cos...commands are in degree mode. And I think those functions are somehow malfunctioned. Could anyone help me fix it?

採用された回答

Star Strider
Star Strider 2014 年 9 月 22 日
It is not in ‘degree mode’. The sin(pi)=0, or as close as MATLAB can get to it, that in this instance is approximately eps.
Compare:
s_rad = sin(pi)
s_deg = sind(pi)
produce:
s_rad =
122.4647e-018
s_deg =
54.8037e-003
  2 件のコメント
Qianliang
Qianliang 2014 年 9 月 22 日
Thank you so much.
Star Strider
Star Strider 2014 年 9 月 22 日
My pleasure!

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

その他の回答 (1 件)

Muthu Annamalai
Muthu Annamalai 2014 年 9 月 22 日
Have you tried the functions,
sind(180)
cosd(90)
etc ?
Also the MAP toolbox has the functions deg2rad and rad2deg
  1 件のコメント
Qianliang
Qianliang 2014 年 9 月 22 日
Thanks, but I am not looking for alternative code. I just want to fix it.

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

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by