Effacer les filtres
Effacer les filtres

highest frequency

6 vues (au cours des 30 derniers jours)
joseph Frank
joseph Frank le 2 Juil 2011
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?

Réponse acceptée

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

Plus de réponses (1)

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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by