I read an image in matlab using
input = imread (\'sample.jpeg\');
Then I do
imhist(input);
It gives this
An histogarm plot will have number of pixels for the intensity levels. Yours is an rgb image. So you first need to convert it to an intensity image.
The code here will be:
input = imread ('sample.jpeg');
input=rgb2gray(input);
imhist(input);
imshow(input);
You will be able to get the histogram of the image.