MATLAB: I wanted to know about the mathematical mechanism to calculate histogram

image processing

i.e How histogram is calculated matlab, i.e if we are given with any sequence let us suppose any binary no 11000100 how will matlab calculate its histogram(mechanism involved)

Best Answer

Histograms are calculated based on sets of data, not based on individual numbers.
If you use hist() then by default the range of values, minimum to maximum, is divided into 10 sections, and then the code effectively loops around for each value, determines which of the 10 sections the value is in, and increments the count for that bin. (The particular case of equally-spaced bins can be optimized, but hist() also handles bins that are not equally spaced.)