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.

 採用された回答

David Fletcher
David Fletcher 2018 年 4 月 12 日
編集済み: David Fletcher 2018 年 4 月 12 日

3 投票

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

1 件のコメント

Fahd Alqahtani
Fahd Alqahtani 2018 年 4 月 12 日
Thanks, David

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Random Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by