how to normalize a matrix?????
Ältere Kommentare anzeigen
hello everyone... i need a code to normalize( between 0 and 1) a matrix 7*50. the normalization process should be for each column not row**. in other words, the program should seek for the largest value in each column and divide all the elements in that column by it. can anybody help plzz
Antworten (3)
James Tursa
am 22 Okt. 2014
Bearbeitet: James Tursa
am 22 Okt. 2014
Assuming values are positive, e.g.,
M = your matrix
N = bsxfun(@rdivide,M,max(M)); % Normalized (scaled) matrix by column
1 Kommentar
MANNY LEN VILLA SUAREZ
am 22 Feb. 2021
excelent,thank you
Greg Heath
am 23 Okt. 2014
2 Stimmen
rng('default')
A = 100*randn(3)
Amin = repmat(min(A),3,1)
Amax = repmat(max(A),3,1)
a = (A-Amin)./(Amax-Amin)
Hope this helps.
Thank you for formally accepting my answer
Greg
1 Kommentar
Image Analyst
am 25 Okt. 2014
abdulkader's "Answer" moved here:
thnaks bro.. that was helpful
Steven Lord
am 22 Feb. 2021
1 Stimme
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!