MATLAB: Increase amount of processor- and RAM used by MATLAB (parfor)

MATLABmemoryparfor

I'm running big calculations and simulations on a powerful computer (8 i7-cores and 12 GB RAM). But for some reason it only uses 10-13% of both RAM and CPU power. How can I increase this?
I suppose the limitation on the CPU is because it only uses 1 of the cores.
If that is the case, I suppose I should use parfor. But since I need to evaluate evaluate a 7-dimensional relation, it is not too straightforward.
An example of the kind of code it has to execute is:
for i=1:length(a)
for j=1:length(b)
for ii=1:length(c)
for jj=1:length(d)
E(i,j,ii,jj) = a(i)^2 * b(j) + c(ii) * d(jj) ^2 + a(i) * c(ii);
end
end
end
end
Can anybody help me out here? Just replacing one of the 'for' with 'parfor' does unfortunately not do the trick.
Thanks

Best Answer

Vectorizing might help, although this looks like it could be a huge matrix, and therefore difficult not only to compute fast, but to store.
aterms=a(:);
bterms=b(:).';
cterms=reshape(c,1,1,[]);
dterms=reshape(d.^2,1,1,1,[]);
E1=bsxfun(@times,aterms.^2,bterms);
E2=bsxfun(@times,aterms,cterms);
E3=bsxfun(@times,dterms,cterms);
E=bsxfun(@plus,E1,E2);
E=bsxfun(@plus,E,E3);