How could normalize a matrix between 0 and 1.

조회 수: 17 (최근 30일)
Edu Gomez
Edu Gomez 2019년 5월 2일
편집: Jan 2019년 5월 3일
I have a matrix 14x15536 how it shows in the picture, and i would like to normalize each row between 0 and 1.
How could I do it??
Thanks in advance.

답변 (2개)

Stephan
Stephan 2019년 5월 2일
result = normalize(x,2,'range')
  댓글 수: 11
Stephen23
Stephen23 2019년 5월 3일
Jan
Jan 2019년 5월 3일
편집: Jan 2019년 5월 3일
Edu Gomez uses R2015a, so no auto-expanding, which was introduced in R2016b. Then bsxfun is required:
rowMin = min(x, [], 2);
result = bsxfun(@minus, x, rowMin) ./ bsxfun(@minus, max(x, [], 2), rowMin);

댓글을 달려면 로그인하십시오.


Edu Gomez
Edu Gomez 2019년 5월 3일
I want say thanks to both for you time and your help, Its very rewarding to have your help for this. Im doing a master thesis and I need a little help with Matlab sometimes.
Thank you very much :))

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by