MATLAB: How to output matrix grayscale

grayscaleImage Acquisition Toolboximage processingImage Processing ToolboxMATLAB

I am trying to output my matrix grayscale with imshow(), but its looks like gradient.
My code is:
s=4;
A=256;
N=200;
i=1:N;
r=0.1*(i-N/2);
f=exp(-r.^2/2/s^2);
M=A*(f'*f);
imshow(M,[]);
Please, help me to find a solution to this problem

Best Answer

This one?
imagesc(M);
Related Question