Why does the function 'angle(complex_input)' output values between +pi and -pi radians? Normal convention is 0 to 2*pi. I find this confusing. What am I misunderstanding? Is there a way to convert this? Simply adding pi to the output did not seem to work.

답변 (4개)

dpb
dpb 2015년 3월 12일
편집: dpb 2015년 3월 12일

2 개 추천

It is consistent with other computer languages for atan2, etc., so for consistency, I presume, TMW chose to keep it that way instead of being "odd man out".
To convert, add 2pi only for angle < 0
Miguel Melnychuk
Miguel Melnychuk 2015년 3월 12일

0 개 추천

That makes sense. Thanks.
Miguel Melnychuk
Miguel Melnychuk 2015년 3월 12일

0 개 추천

Thanks very much everyone. This worked for me. I understand a bit better now.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2015년 3월 12일

답변:

2015년 3월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by