In Matlab nested loops can be slow, and commonly a "vectorized" solution that eliminates loops will be faster. Slow looping used to be the norm in Matlab, but this is less true since MathWorks introduced their "Just-In-Time compiler".
However, vectorized solutions can still be faster for some calculations, because many built-in Matlab functions are multi-core (i.e. automatically run in parallel, when it is efficient to do so).
Without knowing the exact details of your problem I cannot say for sure, but here is an approach which might help. This is essentially the "Integral Image" method to efficiently compute moving-averages, with run-time independent of the filter size.
First, in 1D, say you have a grid $\mathbf{x}=[x_1,...x_{n+1}]$, and a vectorized function $f=@(x)...$ , and you want to compute integrals of $f$ over the cells, i.e. $I_k=\int_{x_k}^{x_{k+1}}f(x)dx$. Then a simple way is sample $f$ at the cell edges, $\mathbf{f}=f(\mathbf{x})$, and integrate assuming $\mathbf{f}$ is piecewise linear:
f=fnc(x); dx=diff(x); fmid=conv(f,[1,1],'valid')/2; I=fmid.*dx;
This is just the trapezoid rule.
To increase accuracy, you may need to sample $f$ at more than just the end-points of each cell. The trick is then to sample $f$ over a finer grid, but sub-sample the cumulative-mass (CDF). This is as above, but changed slightly:
F=cumsum([0,fmid.*dx]); I=diff(F(1:lag:end));
Where for example "lag" could be 10.
In 2D, this approach would be something like this:
f=bsxfun(fnc,x,y'); dA=diff(x)*diff(y)'; fmid=conv2(f,ones(2),'valid')/4;
F=cumsum(cumsum(padarray(fmid.*dA,[1,1],'pre')),2);
I=diff(diff(F(1:lag:end,1:lag:end)),[],2);
parforloop. – Doug Lipinski Aug 06 '15 at 18:30