Distributing the lines of any Matrix Randomly

1 回表示 (過去 30 日間)
Mahmoud Khadijeh
Mahmoud Khadijeh 2019 年 6 月 10 日
コメント済み: Mahmoud Khadijeh 2019 年 6 月 10 日
Hello , I have a question Please
if I have a matrix like this:
A=[ 1 2 3
4 5 6
7 8 9 ] ;
in each time I run the script , I want to redistribute the lines Randomly, for example like these :
A=[ 4 5 6
1 2 3
7 8 9];
-----------------------
A=[ 1 2 3
7 8 9
4 5 6];
Any simple way to do that ?

採用された回答

Shunichi Kusano
Shunichi Kusano 2019 年 6 月 10 日
A(randperm(3,3),:)
hope this helps.
  1 件のコメント
Mahmoud Khadijeh
Mahmoud Khadijeh 2019 年 6 月 10 日
thank you very much,
yes that's exactly what I want

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by