Multivariate normal distribution has peaks I'm trying to calculate a bivariate normal distribution in matlab(with mvnpdf), 
but the pdf I obtain has a strange shape with several peaks.

This is the code I use:
s=[3,1]';
C_ee = [0.0473   -0.1446;
       -0.1446    0.4440]

x1 = -5:.2:5; x2 = -5:.2:5;
[X1,X2] = meshgrid(x1,x2);
F = mvnpdf([X1(:) X2(:)],s',C_ee);
F = reshape(F,length(x2),length(x1));
figure(1);
surf(x1,x2,F);
caxis([min(F(:))-.5*range(F(:)),max(F(:))]);
axis([-5 5 -5 5 0 5])
xlabel('Re'); ylabel('Im'); zlabel('Probability Density');

I've noticed, that when I increase the value of C_ee (sigma matrix), for instance
C_ee+0.05 the shape starts to look normal.
I notice that this matrix is close to not being positive definite... but it still is.
Could anyone explain this behaviour?
Thank you for your time.
 A: Try
x1 = -5:.02:5; x2 = -5:.02:5;

instead.
The problem is that the distribution is quite - but not exactly - parallel to one of your axis. If you consider the $\left\{3.6,3.8\right\} \times \left\{-1.4,-1.2,-1.0,-0.8\right\}$ part of the grid, you will see that it has non-zero pdf in two opposite ''corners'', almost zero everywhere else:
mvnpdf([3.8 -1.4],s',C_ee)
mvnpdf([3.8 -1.2],s',C_ee)
mvnpdf([3.8 -1.0],s',C_ee)
mvnpdf([3.8 -0.8],s',C_ee)
mvnpdf([3.6 -1.4],s',C_ee)
mvnpdf([3.6 -1.2],s',C_ee)
mvnpdf([3.6 -1.0],s',C_ee)
mvnpdf([3.6 -0.8],s',C_ee)

When you use surf, it extrapolates between the grid points you defined, but with $0.2$ step size, it will be insufficient: there won't be a single sampling point in the ''diagonal'' between $(3.8,-1.4)$ and $(3.6,-0.8)$. There will be points along $3.8$ and $3.6$, but there, the pdf is already running at virtually zero, hence at $-1.0$ and $-1.2$ there will be zero for both $3.6$ and $3.8$, so surf will plot zero between them as well. (Incorrectly, of course, but there will be no sampling point between them so that it is discovered.) Thus, you need a finer grid to visualize such close-to-degenerate distribution, the one you used is too coarse.
