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 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!