counts = imhist(I)
[counts, binLocations] = imhist(I)
[counts, binLocations] = imhist(I, n)
| Parameter | Description |
|---|---|
| I | Input intensity or logical image. |
| n | Positive integer number of histogram bins. |
| Parameter | Description |
|---|---|
| counts | Histogram counts as a column vector. |
| binLocations | Bin locations on the native image scale. |
Compute image histogram counts. Bin locations use the native scale for integer images and the range [0, 1] for floating-point and logical images.
I=repmat(linspace(0,1,96),64,1);
[counts,bins]=imhist(I,32);
figure; bar(bins,counts); title('Histogram');
| Version | Description |
|---|---|
| 2.0.0 | initial version |