Info
This question is closed. Reopen it to edit or answer.
could anyone help me to solve the issue.
2 views (last 30 days)
Show older comments
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 Comments
Rik
on 26 Mar 2018
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
on 26 Mar 2018
Edited: Stephen23
on 26 Mar 2018
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.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!