How can I scales the entries of an array to the interval [0,1] in matlab version 2014a?
2 次查看(过去 30 天)
显示 更早的评论
How can I scales the entries of an array to the interval [0,1] in matlab version 2014a? The rescale function in matlab 2014a is not working for this purpose.
0 个评论
回答(2 个)
DGM
2021-5-23
Something like this:
A = rand(5)*10-4 % some random test array
mn = min(A(:));
mx = max(A(:));
B = (A - mn) ./ (mx-mn)
That will scale the data such that its extrema correspond to [0 1]
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!