export frequency data from a histogram

Hi there, I have a histogram that looks like this:
histogram.png
and I would like to extract the frequency data (y-data) so I can make a seperate plot with points.
Any help would bge much appreciated
Many thanks

 Respuesta aceptada

Star Strider
Star Strider el 16 de Abr. de 2019
Use a handle to return the information from the histogram function, then get the values you want:
figure
hh = histogram(x);
edges = hh.BinEdges;
counts = hh.BinCounts;
values = hh.Values;
See the documentation on Histogram Properties (link) for a list of all of them.

5 comentarios

Steven Lord
Steven Lord el 16 de Abr. de 2019
Alternately if you just need the edges and counts data but don't need and/or want the picture, call histcounts instead of histogram.
P_L
P_L el 17 de Abr. de 2019
Thank you both !!
Star Strider
Star Strider el 17 de Abr. de 2019
As always, our pleasure!
James Hughes
James Hughes el 26 de Nov. de 2020
What's the difference between BinCounts and Values? They seem to be the same.
Star Strider
Star Strider el 27 de Nov. de 2020
It’s an example of how to get various data from the function.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

P_L
el 16 de Abr. de 2019

Comentada:

el 27 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by