Organize matrix in a random way

2 ビュー (過去 30 日間)
eden meirovich
eden meirovich 2021 年 4 月 28 日
コメント済み: eden meirovich 2021 年 4 月 28 日
Hello, i have a matrix,H which have N rows and n columns.lets say N = 20 and n is 3. i would like to rearange only the rows in H, in a radom way. but keep every element in the say column he was before. so that h(1,:) will be moved to a radom place h(random number,:)
is there a built in function than can do this?
i think i know how to di it by my self, but can find anything bulit in.
thank u!

採用された回答

Matt J
Matt J 2021 年 4 月 28 日
N=size(H,1);
H=H(randperm(N),:);
  3 件のコメント
Matt J
Matt J 2021 年 4 月 28 日
You're welcome, but please Accept-click the answer to indicate that it resolved the question.
eden meirovich
eden meirovich 2021 年 4 月 28 日
sure! thank u a lot Matt

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParticle & Nuclear Physics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by