How can I row-normalize a symmetric matrix so each row sums to 1?
5 ビュー (過去 30 日間)
古いコメントを表示
Dear MATLAB community,
I am working with the bucky (“W=bucky”) matrix, an NxN matrix where N=60. I would like to row-normalize this matrix so that each row sums up to 1. I am aware of the command norm (and there might be other commands), but I'd like to command this manually, so I can better understand the process behind the calculaton.
If anyone has a clue on how to write this command manually, it is kindly appreciated. Thank you in advance.
Best,
Rajendra
2 件のコメント
回答 (1 件)
Walter Roberson
2019 年 3 月 21 日
The below does retain symmetry. I am not positive at the moment that it would work for matrix that have non-zero entries on the diagonal.
newW = W ./ sum(W,2);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!