How to do permutations on a triangular matrix so that every permuted element goes from a filled to a non-filled cell?
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!