How can I row-normalize a symmetric matrix so each row sums to 1?

조회 수: 6 (최근 30일)
Rajendra
Rajendra 2019년 3월 21일
편집: Rajendra 2019년 3월 21일
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
Walter Roberson
Walter Roberson 2019년 3월 21일
? I do not find anything named normw() ?
Rajendra
Rajendra 2019년 3월 21일
Sorry, that was a typo! Let me fix that. I meant the command norm.

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

답변 (1개)

Walter Roberson
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);

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by