Info

此问题已关闭。 请重新打开它进行编辑或回答。

could anyone help me to solve the issue.

1 次查看(过去 30 天)
Prabha Kumaresan
Prabha Kumaresan 2018-3-26
关闭: MATLAB Answer Bot 2021-8-20
code:
list_of_rng_seeds = [1 2 23]
num_rng = length(list_of_rng_seeds)
for rng_usage_idx = 1 : num_rng
this_seed = list_of_rng_seeds(rng_usage_idx)
fprintf('Below results are for rng = %d\n', this_seed)
rng(this_seed )
unused_rows=1:4
while ~isempty(unused_rows)
N_UE_rows=2;
rows=unused_rows(randsample(length(unused_rows),N_UE_rows))
[~,idx]=find(ismember(unused_rows,rows))
unused_rows(idx)=[]
end
end
The above code works fine. but the list of rng seeds is mentioned as [1 2 23] inorder to have the combinations of 2 users in each group under the condition user present in one group should not be present in other group.Could anyone tell me how the code can be executed without mentioning the list of rng seeds values for different number of users and its combinations.
  2 个评论
Rik
Rik 2018-3-26
You need to make a choice what you want. Either you want to randomize the groups, or you don't. You can of course use some elaborate function to generate a vector of seeds based on the number of groups. Is that what you want?
Stephen23
Stephen23 2018-3-26
编辑:Stephen23 2018-3-26
See earlier questions and discussions:
@Prabha Kumaresan: please do not repeatedly ask the same question, or continuations of the same question. You might feel like asking lots of times is productive, but actually it make it harder for us to keep track of what information you have been given and what you have explained about the situation. It would be easier for everyone, including yourself, if you kept discussions on one topic within one thread.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by