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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by