could anyone help me to rearrange the matrix in the required manner.

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2019년 9월 11일
편집: Bruno Luong 2019년 9월 12일
I ma having a matrix A=[ 1 0 0 0;
2 0 0 0;
3 4 0 0;
5 6 7 0]
i need to rearrange the matrix in the following manner
A=[1 2 3 5;
0 0 4 6;
0 0 0 7;
0 0 0 0]

채택된 답변

Bruno Luong
Bruno Luong 2019년 9월 11일
  댓글 수: 4
Bruno Luong
Bruno Luong 2019년 9월 12일
편집: Bruno Luong 2019년 9월 12일
I can only see one thing that you want beside A.' (but why don't you tell use what is the desired output)?
x = 1:min(size(A));
A(x,x) = A(x,x).'

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by