Hi
I have a matrix A (9X9) and I want to generate a new matrix B using the same matrix of A and should be distributed randomly and each number should be used once to generate matrix B.

 Réponse acceptée

David Fletcher
David Fletcher le 12 Avr 2018
Modifié(e) : David Fletcher le 12 Avr 2018

3 votes

ind=randperm(81)
B=reshape(A(ind),9,9)

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation 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!

Translated by