필터 지우기
필터 지우기

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 CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by