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

 채택된 답변

Star Strider
Star Strider 2019년 4월 16일

0 개 추천

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

Steven Lord
Steven Lord 2019년 4월 16일
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 2019년 4월 17일
Thank you both !!
Star Strider
Star Strider 2019년 4월 17일
As always, our pleasure!
James Hughes
James Hughes 2020년 11월 26일
What's the difference between BinCounts and Values? They seem to be the same.
Star Strider
Star Strider 2020년 11월 27일
It’s an example of how to get various data from the function.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

질문:

P_L
2019년 4월 16일

댓글:

2020년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by