How to do random grouping of users for the following code

1 次查看(过去 30 天)
C= [0 0 0 0 0.00468466484961233 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0.00473152126698343 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0.00320415141017349 0 0 0 0 0.00395741110162883 0 0 0 0 0 0 0 0 0.00175904431297154 0 0 0 0;
0 0 0 0 0 0 0 0 0 0.00126423279464793 0 0.000983514611652531 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0.0136795308389000 0 0 0.0153320263400028 0 0 0 0 0 0 0 0 0;
0 0 0.0108635117533229 0 0 0 0 0 0 0 0 0 0 0.0265572645423627 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0818848666172931;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.000663090878878465 0 0 0;
0.472219273229167 0 0 0 0 0 0 0 0.778196919491401 0 0 0 0 0 0.937658769263643 0 0 0.769774237299979 0 0;
0 0 0 2.29571394964644 0 0 0 0 0 0 0 0 4.00677681057393 0 0 0 0 0 2.98318348373007 0]
s = size(C,1);
p = mod((0:s-1)+randi(s-1,1,s),s)+1; % p(k) never equals k
B = C;
for k = 1:s
B(p(k),k) = B(k,k);
end
Could anyone tell me how to do user grouping for the code mentioned above.
  2 个评论
the cyclist
the cyclist 2017-12-26
Nothing in your code indicates what you mean by "user", or what kind of grouping you want. Please provide enough information for us to actually help you without guessing. Be specific!
Image Analyst
Image Analyst 2017-12-26
Shouldn't this be a follow up to one of the 10 other times you asked this?

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2017-12-26
No, we cannot. In this and your previous 60 or so questions on this topic, you have consistently refused to post a statement of requirements -- a document setting out exactly what has to be done. What is the smallest number of groups you might have? What is the largest number of groups you might have? What is the smallest number of users you might have? What is the largest number of users you might have? What is the smallest number of groups that any one user might belong to? What is the largest number of groups that any one user might belong to? Is the number of groups per user to be divided up as evenly as possible, or is it permitted for one user to belong to 517 groups and another user to belong to only 2? Is the number to be uniform random, or is it to be Beta distribution or is it to be Poisson distribution?
If all members of the same group are to share all of the carriers of the group, then the problem becomes the same as your earlier questions about dividing up users into groups, with the only difference being that instead of starting with user indices and dividing those up into groups, that you start with carrier indices and divide those up into groups. If each user is to have exactly two "primary" carriers, then divide the carrier indices up into groups with an even number of entries in each group, then take the length of each and divide in half and assign that many users to the group.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by