normalize a vector of points belonging to the interval [a,b]

2 次查看(过去 30 天)
Hi, given an interval [a,b] where a and b can take either positive or negative value. how can i normalize a vector of points belonging to the interval [a,b]. Thanks

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-11-16
编辑:Azzi Abdelmalek 2013-11-16
a=10;
b=20;
v=rand(1,10)*5+1
n_data = a+(b-a)*(v-min(v))/( max(v)-min(v))

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by