selecting unique values

13 views (last 30 days)
kash
kash on 12 Jan 2012
i have a matrix and i have to select unique values based on first column
i.e
1 2 3
3 4 6
1 4 6
i need as
1 2 3
3 4 6
please help

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 12 Jan 2012
in this case:
I = [1 2 3
3 4 6
1 4 6]
[b b] = unique(I(:,1),'first')
out = I(b,:)
please read about unique

More Answers (0)

Categories

Find more on Dynamic System Models in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!