I have the following range from a much larger matrix :
range(a)
ans =
94 153 144 59 79 90 131 64
My professor is asking us to: Divide the range into N = 10 equal-length segments (hereafter called “bins”), and for each bin, find its bounds (aj, bj) as well as its center cj.
(5) Place each measured bacterial count xi into that bin whose lower bound is less than or equal to xi and whose upper bound is greater than xi; thereafter, for each bin count the number of xi assigned to it (= nj).
(6) Plot a histogram of the measured bacterial counts using N = 10 bars. Try the MATLAB functions hist(x,N) and bar(c, n)
I know this is a lot, but I have absolutely no instruction from this guy and would really appreciate a helping hand :)
computing histogram:
xout
is bin centers,n
bin counts.plotting bar graph:
computing bin edges: