MATLAB: Converting 0-inf degrees into 0-360

anglecosineperiodicsine

Hi!
I'm looking for the most elegant way of returning a continously rotating angle (0 – inf) degrees into cycles of 0 to 360 degrees.
Any tips? 🙂 Thanks

Best Answer

Let your input angle ang :
ang = 0:30:500;
ang360 = rem(ang,360);