MATLAB: Triple integral of multivariate gaussian pdf

joint gaussiantriple integral

I want to integrate a function that includes joint gaussian pdf over different intervals, and I first try a simpler case as follows
sigma = [1 0 0; 0 1 0; 0 0 1]; % Cov matrix

theta = 0.001;
F = @(t, m, n) (t^2) * (det(sigma)*(2*pi)^3)^(-0.5) * exp(-0.5*transpose([t; n; m]) * inv(sigma) * [t; n; m]); % objective func
integ = integral3(@(t, m, n) arrayfun(F, t, m, n), -100, 100, -100, 100, -10, 10)/theta^2;
I can get a result of 1.8e-12. However, my goal is to integrate variable n over the interval [-theta*|m|, theta*|m|], so I did the following
sigma = [1 0 0; 0 1 0; 0 0 1]; % Cov matrix
theta = 0.001;
F = @(t, m, n) (t^2) * (det(sigma)*(2*pi)^3)^(-0.5) * exp(-0.5*transpose([t; n; m]) * inv(sigma) * [t; n; m]); % objective func
low = @(m) -theta * abs(m); %lower limit
high = @(m) theta * abs(m); %higher limit
integ = integral3(@(t, m, n) arrayfun(F, t, m, n), -100, 100, -100, 100, low, high)/theta^2;
and matlab says that
Error using @(m)-theta*abs(m) Too many input arguments.
How can I modify the code to integrate over such a coupled interval?

Best Answer

ok, i found out that the following seems to work
low = @(t,m) -theta * abs(m); %lower limit
high = @(t,m) theta * abs(m); %higher limit