How to do permutations on a triangular matrix so that every permuted element goes from a filled to a non-filled cell?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Operating on Diagonal Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!