How can I change all negative angles in 20 x 5000 cells to positive? i.e. -167deg. to 193deg.

조회 수: 9 (최근 30일)
Hi, I am new to MATLAB. Please see the title.
I need to keep the positives unchanged.
Cheers,
Ed

채택된 답변

Guillaume
Guillaume 2016년 2월 25일
The modulo operation is your friend:
angles = [-167 0; 90 -270] %for example
angles = mod(angles, 360)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by