MATLAB: Re-sizing vectors

angledimensioningdimensionselaborateelaboratingeulerianeulerian angleMATLABvectorvectors

I am working on a project that works with angles, and I have at my disposal a vector, that shows the angle elaborated and acquired from a sensor.
The only problem is that when I plot the vector, the y-axis has different values from the eulerian angle (see the image attached). I know which sample stands for the maximum angle and which sample stands for the minimum angle, but I can't find a way to " re-sizing" the vector by associating maximum and minimum angle and change all the samples variating within that range.
Does anyone have any suggestions on the code? Perhaps a function?
Thank you in advance for your time MatLAB community!!

Best Answer

If you want to change the range of the y-values, you can do it by first normalizing and then denormalizing to your required range
x = [1xn signal]
xNormalized = (x-min(x))/(max(x)-min(x))
newMin = 0;
newMax = 90; % new minimum and maximum value of the signal you want
xNew = xNormalized*(newMax - newMin) + newMin;
xNew will have same shape of x but varies from newMin to newMax.