I have been trying to integrate a multivariate Gaussian pdf in 3,4 and 6 dimensions for a certain problem. The full solution of the problem would involve integrating functions of the normal pdf so that merely computing the CDF wont do. The integration limits are constants. For 3 dimensions, I tried the following code.
Error using mvnpdf (line 67)
X and MU must have the same number of columns.
And for 4D I used the answer provided at this link(<http://www.mathworks.com/matlabcentral/answers/77571-how-to-perform-4d-integral-in-matlab>) and got the following error message.
>> Q = integral(@(x)integral3(@(y,z,w)mvnpdf([x,y,z,w],mu2',cov2),-2,3,-1,1,-3,1),-2,1,'ArrayValued',true);
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Error in @(y,z,w)mvnpdf([x,y,z,w],mu2',cov2)
I tried a similar nested approach using integral3 for 6D integral. But it gave an error too.