How to normalize data between 0 and 1
175 次查看(过去 30 天)
显示 更早的评论
Hello everyone, i hope you are doing well.
I have the following data.
I want to normalize the data between 0 and 1
How can i do that
0 个评论
回答(2 个)
Davide Masiello
2022-3-3
Given the matrix A that you want to normalise, you could write
A = A/max(A(:));
1 个评论
Image Analyst
2022-3-3
He wants the output to go between 0 and 1. Your code will not put the min at 0 unless it is already 0. The easiest solution is to just use
A = rescale(A, 0, 1);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!