I am trying to solve a problem of the following form:
f=@(x,y,z,w) x.*y.*z.*w; % A complicated black box function
a=1;b=1;c=1;d=1;
integral2 calls its integrand with two matrix arguments of the same size. The problem is that you can't just mix the variables x,y,z,w in the function call f(x,y,z,w) as you did in your question, because the dimension of x and y is determined by the outer integral2, whereas the dimension of z and w is determined by the inner integral2, so is isn't guaranteed that the dimensions are the same. The integralX functions don't vectorize anyway, each call can provide just one output value.
The function integral provides an option so that it calls its integrand only with scalar values, and with Matlab scalar expansion, this works together with the same-sized 3D arrays the inner function integral3 provides.
I=integral(@(x)integral3(@(y,z,w)f(x,y,z,w),b,-b,c,-c,d,-d),a,-a,'ArrayValued',true);
You can achieve the same (calling with scalars) by encapsulating the inner integral2 call with arrayfun:
I=integral2(@(x,y)arrayfun(@(x,y)integral2(@(z,w)f(x,y,z,w),c1,c2,d1,d2),x,y),a1,a2,b1,b2)
The latter was about six times faster in my experiments.
To add to Daniel's answer, I finally broke down and wrote a MATLAB File Exchange submission that does the nesting for you automatically, and it can handle the more tedious cases where the limits are functions rather than constants. It's called integralN, and it is written to handle 4-fold, 5-fold, and 6-fold integrals. I don't think it's a great way of attacking higher-dimensional integration, but if it happens to be fast enough to get the job for you, then it's there to use.