How to get the frequency of a column of values

15 visualizaciones (últimos 30 días)
Leon
Leon el 21 de En. de 2014
Comentada: Leon el 21 de En. de 2014
I have a column of data containing the study year of the sampling stations:
1950
1953
1953
1953
1957
1957
1959
1959
1959
1959
...
I want to plot something like histogram myself.
How do I get a two column data, with the left column containing all the possible years, and the right column containing their frequencies?
1950, 1
1953, 3
1957, 2
1959, 4
Thanks.

Respuesta aceptada

Amit
Amit el 21 de En. de 2014
table = tabulate(A); % where A is your data
% if you want exactly the way you said
table(:,3) = [];
  1 comentario
Leon
Leon el 21 de En. de 2014
This is exactly what I am looking for!
Thank you very much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by