MATLAB: Find and replace array elements that meet a condition

find array elements that meet a conditionreplace values that meet a condition

I have an array
I have alreay found values in that array the equal 360 and replaced them with 0.
My question is, how do I then find values greater than 360 and replace them with 'that value – 360' ?

Best Answer

You need to replace the value, just use rem()
x = 0:1000;
y = rem(x, 360)