Hi,
Trying to split a data file into equal groups of 3, with each bit of data unique from the output. I have tried the following code(s):
[x y] = xlsread('cloodo','data');data = y;y1=numel(y); for i=1:12 player(:,i) = unique(y(randperm(y1,3)));endand[x y] = xlsread('cloodo','data');data = y;y1=numel(y); player1 = unique(y(randperm(y1,3)));player2 = unique(y(randperm(y1,3)));player3 = unique(y(randperm(y1,3)));player4 = unique(y(randperm(y1,3)));player5 = unique(y(randperm(y1,3)));player6 = unique(y(randperm(y1,3)));player7 = unique(y(randperm(y1,3)));player8 = unique(y(randperm(y1,3)));player9 = unique(y(randperm(y1,3)));player10 = unique(y(randperm(y1,3)));player11 = unique(y(randperm(y1,3)));answer = unique(y(randperm(y1,3))); writecell(player1)writecell(player2)writecell(player3)writecell(player4)writecell(player5)writecell(player6)writecell(player7)writecell(player8)writecell(player9)writecell(player10)writecell(player11)writecell(answer)
but some of the values are repeated.
Any help would be greatly appreciated
Best Answer