How to normalize data between 0 and 1

220 visualizzazioni (ultimi 30 giorni)
Med Future
Med Future il 3 Mar 2022
Commentato: Image Analyst il 3 Mar 2022
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

Risposte (2)

Simon Chan
Simon Chan il 3 Mar 2022
Another option is use function rescale

Davide Masiello
Davide Masiello il 3 Mar 2022
Given the matrix A that you want to normalise, you could write
A = A/max(A(:));
  1 Commento
Image Analyst
Image Analyst il 3 Mar 2022
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);

Accedi per commentare.

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by