How to plot Histogram for a set of data in already associated with counts?

4 views (last 30 days)
I have a set of data in which certain values shall be counted as full cycle and certain as half cycle. eg. Values=[ 100 100 101 102 100 102 101 101] and no. of cycles=[0.5 1 1 1 0.5 0.5 1 0.5]
here I want to plot a histogram of the values depending on how many no. of cycles each occur.
Is there any easy command to consider this in matlab.
Thanks in advance, Atmaram

Answers (1)

Steven Lord
Steven Lord on 9 Nov 2017
Do you want a bivariate histogram plot (X axis represents Values, Y axis represents number of cycles, Z axis represents how often a particular Value-Cycles combination occurs?) If so use the histogram2 function.
If that's not what you want, you might want to look at the histogram function with the 'BinCounts' and 'BinEdges' parameters instead.

Tags

Community Treasure Hunt

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

Start Hunting!