close all n=500; mu =[n,n]; sigma = [40000 0; 0 40000]; [X,Y] = meshgrid([0:1:2*n]); p = mvnpdf([X(,Y(],mu,sigma); p = reshape(p,size(X)); figure(2) surf(X,Y,p); shading interp colorbar figure; imshow(p,[])