how to normalize a matrix?????
이전 댓글 표시
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
답변 (3개)
James Tursa
2014년 10월 22일
편집: James Tursa
2014년 10월 22일
Assuming values are positive, e.g.,
M = your matrix
N = bsxfun(@rdivide,M,max(M)); % Normalized (scaled) matrix by column
댓글 수: 1
MANNY LEN VILLA SUAREZ
2021년 2월 22일
excelent,thank you
Greg Heath
2014년 10월 23일
2 개 추천
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
Image Analyst
2014년 10월 25일
abdulkader's "Answer" moved here:
thnaks bro.. that was helpful
Steven Lord
2021년 2월 22일
1 개 추천
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!