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

8 vues (au cours des 30 derniers jours)
Hi, I am new to MATLAB. Please see the title.
I need to keep the positives unchanged.
Cheers,
Ed

Réponse acceptée

Guillaume
Guillaume le 25 Fév 2016
The modulo operation is your friend:
angles = [-167 0; 90 -270] %for example
angles = mod(angles, 360)

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by