フィルターのクリア

How do I randomly select ax,ay, az values and assign it to a node?

1 回表示 (過去 30 日間)
sree chak
sree chak 2020 年 9 月 1 日
回答済み: Steven Lord 2020 年 9 月 1 日
I am trying to set up a simulation and wanted to know how to do the following:
I have a matrix of values and a max of N nodes (N=3 in this case). For each node, I want to randomly assign one of the rows below such that all three nodes get assigned a different row.
A = [1 2 3; 4 5 6; 7 8 9]
So for e.g: in one simulation node1 -> N1 may have the A values of [1 2 3]; N2 may have [4 5 6] and N3 may have [7 8 9].
When I rerun it => N1 may have the A value of [4 5 6], N2 may have [7 8 9] and N3 may have [1 2 3].
If I can get some help regarding this, it would super helpful.

採用された回答

Steven Lord
Steven Lord 2020 年 9 月 1 日
The randperm function will be of use to you.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by