figure;
histogram = hist(np,180);
name=['histogram-' int2str(k) '.png'];
%% k is the iterator so basically I want to save all the images using a loop.
imwrite(out,name);
The image I got is only a horizontal line. Does someone know how to fix this?