画高斯分布图 matlab (2D/3D)

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,[])

你可能感兴趣的:(matlab)