Matlabには、画像のヒストグラムを描画するための関数histが付属しています
Matlab Comes With Function Hist Draw Histogram An Image
a = double(imread('rice.png'))% matlab comes with pictures hist(a(:),10)% is divided into ten bins
効果画像:
[N,X] = hist(...) also returns the position of the bin centers in X.
[no,xo] = hist(a(:),10)
noは各ビンに対応するy値です
xoは、各ビンの中心位置x値です。