Finding distinct values in a column of a matrix
    4 views (last 30 days)
  
       Show older comments
    
    divya r
 on 29 Jun 2012
  
    
    
    
    
    Commented: Abdulaziz Abutunis
 on 18 Aug 2021
            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.
0 Comments
Accepted Answer
  Walter Roberson
      
      
 on 29 Jun 2012
        unique( a(:,1) )
1 Comment
  Abdulaziz Abutunis
 on 18 Aug 2021
				Hi Walter,
I hope you are well. 
Can we maintain full arrays corresponding to these unique vlaues 
Thanks 
Aziz
More Answers (0)
See Also
Categories
				Find more on Loops and Conditional Statements 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!