How to manipulate data between two numbers?

4 Ansichten (letzte 30 Tage)
John Doe
John Doe am 7 Jul. 2018
Beantwortet: dpb am 7 Jul. 2018
I have multiple vectors and numbers in all of them lie between 0 and 1, I want to do 'normalize' the data such that the maximum point in each vector now definitely touches 1 and minimum point definitely touches 0 and numbers in between gets manipulated accordingly.
How can I do this?

Akzeptierte Antwort

dpb
dpb am 7 Jul. 2018
Any number of ways; a couple...
z=interp1([min(x) max(x)],[0 1],x);
b=polyfit([min(x) max(x)],[0 1],1);
z=polyval(x);

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by