How to Mapping Values
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ramakrishna Bajaj
am 1 Dez. 2017
Kommentiert: Ramakrishna Bajaj
am 1 Dez. 2017
how to map values of (3 to 4) to (1.4 to 4)?
thanks.
2 Kommentare
Akzeptierte Antwort
M
am 1 Dez. 2017
Suppose you have :
x=[3.35 3.4 3.8 3.9 4 4.08];
and you want to scale it to the interval [a b]
a=1.4;
b=4;
you can do it like this :
y = (x-min(x))*(b-a)/(max(x)-min(x)) + a;
y =
1.4000 1.5781 3.0027 3.3589 3.7151 4.0000
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!