The integrals in the numerator and denominator of φ(z,j) are actually double integrals of ψ w.r.t. x and y, so I calculated them that way in the loop, substituting in the required values for z, and then computed φ(z,j) from them and beta. (The entire calculation required about 214 seconds on my machine.)
This code:
zv = 0.1:0.1:1;
jv = 0:31;
fpsixyz = @(x,y,z) exp(-(((x-y).*z).^2)/4)./(1+y.^2);
B = @(j) 1E-5 * 2.^j;
for k1 = 1:size(jv,2)
for k2 = 1:size(zv,2)
z = zv(k2);
psiz = integral2(@(x,y) fpsixyz(x,y,z), 0, Inf, -Inf, Inf);
j = jv(k1);
phizj(k1,k2) = psiz ./ (B(j) + psiz);
end
end
figure(1)
surfc(phizj)
xlabel('\itz\rm')
ylabel('\itj\rm')
zlabel('\phi(\itz, j\rm)')
set(gca, 'XTick', 1:2:10, 'XTickLabel', zv(1:2:end))
axis([xlim 0 31 0 1])
produces:
Best Answer