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 CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by