How to normalize matrix by specific columns matlab?
2 ビュー (過去 30 日間)
古いコメントを表示
Wiktoria Bukowska
2020 年 1 月 3 日
コメント済み: Wiktoria Bukowska
2020 年 1 月 3 日
Hi everyone,
I have matrix 366x35. I would like to normalize values by specific columns, it means that only columns 1-33 should be normalized and others (34-35) should keep previous values. How I can do that?
0 件のコメント
採用された回答
Walter Roberson
2020 年 1 月 3 日
One kind of normalization:
YourMatrix(:,1:33) = YourMatrix(:,1:33)./sum(YourMatrix(:,1:33));
Another kind:
YourMatrix(:,1:33) = mat2gray(YourMatrix(:,1:33)); %normalizes between min and max of the entire set of columns
Another kind:
min33 = min(YourMatrix(:,1:33));
max33 = max(YourMatrix(:,1:33));
range33 = max33 - min33;
YourMatrix(:,1:33) = (YourMatrix(:,1:33) - min33)./range33; %normalizes each column to 0 to 1 independently
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!