export frequency data from a histogram

41 visualizzazioni (ultimi 30 giorni)
P_L
P_L il 16 Apr 2019
Commentato: Star Strider il 27 Nov 2020
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

Risposta accettata

Star Strider
Star Strider il 16 Apr 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 Commenti
James Hughes
James Hughes il 26 Nov 2020
What's the difference between BinCounts and Values? They seem to be the same.
Star Strider
Star Strider il 27 Nov 2020
It’s an example of how to get various data from the function.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by