how to normalize data between specific range

51 次查看(过去 30 天)
Hi
I have triangle signal starting from different negative values go to positive values and comeback to negative values. I want them to normalize between 0 and 1 so that there starting values will be same Itried to use this formula.
" normalized_data = data-min(data)/max(data)-min(data)"
by using above values I can align maximum values and ending points but I want to allign its starting point and its maximum point. Can any one help me what should I do.
Regrads,
Haziq

采纳的回答

Akira Agata
Akira Agata 2020-2-25
To normalize data to [0 1], you need to add ( ) correctly, like:
normalized_data = (data-min(data))/(max(data)-min(data));
Another (and more easy) way is to use rescale function.
normalized_data = rescale(data);

更多回答(1 个)

Steven Lord
Steven Lord 2020-2-26
Use the normalize function.
  1 个评论
Muhammad Haziq
Muhammad Haziq 2020-2-26
Hi,
Thanks for replying. I use the normalize function I am unable to allign starting points of the signals.
regards,
Haziq

请先登录,再进行评论。

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by