I would like to construct a histogram with unequal bins (intervals)..Matlab construct only histograms with equal bins as if it's a diagram..!!!
Please help me...thanks a lot!!
Most histograms use bin widths that are as equal as possible, but it is also possible to use unequal bin widths (see the 'Variable bin widths' section of Histogram). A recommended strategy is to size bins so the number of values they contain is approximately equal.
The bins (intervals) must be adjacent and are often (but not required to be) of equal size. To roughly assess the probability distribution of a given variable by depicting the frequencies of observations occurring in certain ranges of values.
Description. N = morebins( h ) increases the number of bins in histogram h by 10% (rounded up to the nearest integer) and returns the new number of bins. For bivariate histograms, this increases the bin count in both the x and y directions.
Here's an example:
x = randn(100,1)*3; %# some random data
e = [-10 -5 -3 -1 1 2 3 20]; %# edges of intervals: e(i) <= x < end(i+1)
c = histc(x,e); %# get count in each interval
bar(e, c, 'histc') %# bar plot
set(gca, 'xlim',[e(1) e(end)])
2 solutions:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With