highest frequency

1 次查看(过去 30 天)
joseph Frank
joseph Frank 2011-7-2
Hi,
is there a matlab function that computes the highest frequency of occurences? for example: A=[3423 3420 3423 3421 3423 3523 3524 3545 3644 3999]; how can i get as an answer 3423 since it occurs the most?

采纳的回答

Rick Rosson
Rick Rosson 2011-7-2
Please try the mode function:
x = mode(A);
HTH.

更多回答(1 个)

Oleg Komarov
Oleg Komarov 2011-7-2
A = [3423 3420 3423 3421 3423 3523 3524 3545 3644 3999];
unA = unique(A);
counts = histc(A,unA);
[m,idx] = max(counts);
unA(idx)

类别

Help CenterFile Exchange 中查找有关 Array Geometries and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by