How to take frequent values from an array in matlab
I have an array of values l开发者_JAVA百科ets say:
a =
77.0000 83.3400 131.9300 131.9300 109.0600 37.6800 76.7100 189.3300
443.5000 328.1500 343.6400 343.6400 272.6000 421.8600 393.7900 353.8400
Now I want to get frequent values from 1st row of this array like this:
b = [131.9300 131.9300]
and all other values that are near 131.
Try:
>> [val count] = mode( a(1,:) )
val =
131.93
count =
2
精彩评论