clear; pollenmat = imread('Fig3.10(b).jpg'); u = double(pollenmat); [nx ny] = size(u) nshades = 256; hist= zeros(nshades,1); for i=1:nx for j=1:ny for k=0:nshades-1 if u(i,j)==k hist(k+1)=hist(k+1)+1; end end end end plot(hist);