imshow command for Gaussian function
Why not to simply use either:

imagesc(z);


Or:

h=pcolor(z)
set(h, 'LineStyle','None')


Although if you really want to use imshow then provide a set of extra parameters to scale the plotting range. It's more computational and memory efficient. 

imshow(z, [min(min(z)) max(max(z))])