How to do permutations on a triangular matrix so that every permuted element goes from a filled to a non-filled cell?
이전 댓글 표시
Hi, all. I want to create a shuffled matrix that comes from a triangular matrix. The point is to permute elements from the initially filled points (under the main diagonal) to the initially empty points (above the diagonal).
The tricky part is that I need it to randomly select points (say 10, 25 or 50% of the total filled points) to be permuted and that the number of empty and filled points in initial and final matrices shall be the same.
To make things a bit more interesting, on the top of all that, the main diagonal shall be made of zeros only.
Any suggestions?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!