Azzera filtri
Azzera filtri

Finding distinct values in a column of a matrix

7 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Walter Roberson
Walter Roberson il 29 Giu 2012
unique( a(:,1) )
  1 Commento
Abdulaziz Abutunis
Abdulaziz Abutunis il 18 Ago 2021
Hi Walter,
I hope you are well.
Can we maintain full arrays corresponding to these unique vlaues
Thanks
Aziz

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by