@andrei:
This does not work because it returns several rows which contain the same element. What I am looking for is a matrix of rows which only contain unique elements. In the above example, this is a single row [1 2 3], but in principle could be much larger. As an example, consider the following:
x = allcomb(1:5, 1:5, 1:5);
y = unique(sort(x, 2), 'rows');
y(y(:,1) == y(:,2) | y(:,1) == y(:,3) | y(:,2) == y(:,3), :) = []
Thanks, Dan
[I accidentally hit the accept this answer button. Please disregard.]
Best Answer