How could normalize a matrix between 0 and 1.

16 ビュー (過去 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 Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by