How to calculate repetition of an unknown number present in 2nd column of a 150*2 matrix?
Show older comments
I've a matrix a=[1,1;2,1;3,1;4,4;5,4] . Actually numbers in the 2nd column are not known in a general case. So, how can i count how many numbers have a particular number (say 1,4) in their corresponding 2nd column.
1 Comment
KSSV
on 20 May 2016
How you can find out with out knowing the numbers?
Accepted Answer
More Answers (1)
Alessandro Masullo
on 20 May 2016
0 votes
You can use the function hist (or histc) on the second column of your matrix.
Categories
Find more on Logical 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!