MATLAB: Convert discontinuos angles to continuous angle

anglescontinuous anglesdiscontinuoes anglesMATLAB

Hi, I need help to convert discontinuous angles to continuous angle in my plots, anyone to help me? I saw something to matlab simulink, but I would want to change in code. Thank you for your help.
For other words, I have this plot,
and I want to convert for this plot,
Best wishes, Paulo Oliveira

Best Answer

idx=theta>0;
theta(idx)=theta(idx)-360;