Convert discontinuos angles to continuous angle

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

 Accepted Answer

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

8 Comments

Both improve the function, but it is not the solution for my problem. Thanks.
Matt J, What was your reasoning to apply this formula? Explain me, to try modify. Thanks. Best wishes
Your figure makes it looks like the positive theta have been pushed up by a simple uniform 360 degree jump relative to the desired curve. I proposed just to subtract that jump off again.
Yes, your reasoning is right, but I have too negative theta, the image is not real is just a example, but I put my matrix for you test, ok?
Matrix: -81.5032 -81.0033 -80.3730 -79.6162 -78.7395 -77.7483 -76.6428 -75.4151 -74.0509 -72.5332 -70.8465 -68.9806 -66.9335 -64.7122 -62.3332 -59.8229 -57.2177 -54.5626 -51.9075 -49.3014 -46.7880 -44.4037 -42.1773 -40.1307 -38.2797 -36.6360 -35.2065 -33.9931 -32.9907 -32.1874 -31.5654 -31.1028 -30.7734 -30.5467 -30.3897 -30.2694 -30.1534 -30.0111 -29.8126 -29.5278 -29.1260 -28.5767 -27.8513 -26.9262 -25.7832 -24.4111 -22.8068 -20.9803 -18.9584 -16.7868 -14.5269 -12.2513 -10.0374 -7.9576 -6.0700 -4.4133 -3.0059 -1.8485 -0.9274 -0.2148 0.3314 0.7664 1.1556 1.5743 2.1153 2.9088 4.1650 6.3004 10.5024 23.6964 145.5493 177.4513 -173.6526 -166.1859 -157.8700 -148.0553 -136.7891 -124.7509 -112.9791 -102.3417 -93.2169 -85.5723 -79.1925 -73.8367 -69.3017 -65.4342 -62.1261 -59.3062 -56.9309 -54.9734 -53.4137 -52.2305 -51.3988 -50.8891 -50.6660 -50.6885 -50.9109 -51.2841 -51.7581 -52.2864 -52.8275 -53.3476 -53.8203 -54.2272
See the plot and you understand me, perfectly :)
Thanks Best wishes
You could also try unwrap().
I already tried unwrap, but this function is just used in rad and in Biomechanics the rad is the SI, but the athletes understand better in degrees. Yes, unwrap is a solution, but I like more your first idea, I have explore more.
but this function is just used in rad
Working in degrees would be just a simple modification
unwrap(thetaDegrees*pi/180)*180/pi;
Yap, it works perfectly. Thank you very mush. ;)
Best wishes PO

Sign in to comment.

More Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!