How to truncate this matrix

3 views (last 30 days)
Am
Am on 9 Nov 2013
Edited: Azzi Abdelmalek on 9 Nov 2013
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

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 9 Nov 2013
unique(a,'rows')

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!