Hello everyone,
for the analysis of a measurement I'm trying to use the multivariate normal distribution function mvnpdf.
This is the code I'm using:
X = rand(27,27)
mu = mean(X)
Sigma = cov(X)
x1 = 0:0.1:2.6; x2 = 0:0.1:2.6;
[X1,X2] = meshgrid(x1,x2);
F = mvnpdf([X1(:) X2(:)],mu,Sigma);
I then get the following error message:
Error using mvnpdf (line 67)
X and MU must have the same number of columns.
I don't understand this, since the number of columns is 27 for each of the variables I'm using.
I'm using Matlab R2018a.
Does anyone have an idea why I get this error?
Best regards & thanks for any help!
Best Answer