Re-generate random matrix

1 Ansicht (letzte 30 Tage)
Fahd Alqahtani
Fahd Alqahtani am 12 Apr. 2018
Kommentiert: Fahd Alqahtani am 12 Apr. 2018
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.

Akzeptierte Antwort

David Fletcher
David Fletcher am 12 Apr. 2018
Bearbeitet: David Fletcher am 12 Apr. 2018
ind=randperm(81)
B=reshape(A(ind),9,9)

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by