MATLAB: How to solve randperm error with words

charMATLABmatrixrandomrandperm

I had create this code
Tile = {'house', 'core', 'word', 'ask', 'question', 'horse', 'phone', 'eyes', 'hair', 'man'};
>> X = X(randperm(size(X,1)),:);
>> Error undefined function or variable X
I would have all possible random combinations pairs without repetitions and without have the same values (e.g horse – horse). How can I do?

Best Answer

[x,y]=ndgrid(Tile);
xy=[x(:),y(:)];
xy(~strcmp(xy(:,1),xy(:,2)),:)