24 views (last 30 days)

hello,

ho to normalize the values of a matrix to make it greater than zero and less than one?

regards,

Matt J
on 23 Oct 2018

Edited: Matt J
on 23 Oct 2018

B=(A-min(A(:)))/(max(A(:))-min(A(:))) ;

Walter Roberson
on 23 Oct 2018

delta = max(eps(A(:));

B=(A-min(A(:))+delta)/(max(A(:))-min(A(:))+delta) ;

madhan ravi
on 23 Oct 2018

Edited: madhan ravi
on 23 Oct 2018

Try :

Np = normalize(A,'norm',1) % A your matrix

Opportunities for recent engineering grads.

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

Start Hunting!
## 2 Comments

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/425701-how-to-normalize-the-values-of-matrix-to-make-it-greater-than-zero-and-less-than-one#comment_626952

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/425701-how-to-normalize-the-values-of-matrix-to-make-it-greater-than-zero-and-less-than-one#comment_626952

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/425701-how-to-normalize-the-values-of-matrix-to-make-it-greater-than-zero-and-less-than-one#comment_626965

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/425701-how-to-normalize-the-values-of-matrix-to-make-it-greater-than-zero-and-less-than-one#comment_626965

Sign in to comment.