Finding distinct values in a column of a matrix

I have a 81*4 matrix. I want to find the distinct values only in the first column, which can also be seen as the first column of every row.
eg: a= 2 3
4 3
4 5
2 3
ans should be = 2
4
unique() is of no use here, it supports only whole row distinction.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 29 Jun. 2012

4 Stimmen

unique( a(:,1) )

1 Kommentar

Hi Walter,
I hope you are well.
Can we maintain full arrays corresponding to these unique vlaues
Thanks
Aziz

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by