MATLAB: How to truncate this matrix

mfile

I have a sorted 15*3 matrix as follows:
a=[ 4 3 2;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
3 3 3;
2 3 4;
2 3 4;
2 3 4;
2 3 4]
how can I transform this matrix to a new matrix where the vectors with more than 1 duplication will be omitted so as in the final matrix only exclusive vectors with no repetition is generated. for instance instead of 10 repetition of vector 3 3 3 only one vector is generated in the new matrix. In other words, how the above matrix can be transferred to [4 3 2; 3 3 3; 2 3 4] ?? thanks

Best Answer

unique(a,'rows')
Related Question