For example my integral looks like this
INTEGRAL(V.*(1-x./I).^(0.5), x, 0, I) So I have to take integral for x from 0 to I, where V and I are matrices with the size of NxM, BUT the most important I just have to take NxM integrals
INTEGRAL(V(i,j).*(1-x./I(i,j)).^(0.5), x, 0, I(i,j)) and in the end to get matrix NxM of integrals.
I tried
time2=@(Id, I, vp, a) (1./(vp.*(1-Id./I).^(a+1)).^(0.5));
time = zeros(size(vp));
for j=1:size1
for k=1:size2
time3=integral(@(Id)time2(Id, I(j,k), vp(j,k), a),0,I(j,k));
end
time(j,k)=time3;
end
but the message There may be a singularity, or the tolerances may be too tight for this problem. and my results unnormal
also I tried
time3 = arrayfun(@(I, vp) integral(@(Id)(1./(vp.*(1-Id./I).^(a+1)).^(0.5)),0,I), I, vp);
and I got my matrix but with non expected value and a message
Minimum step size reached near x = 0.293275. There may be a singularity, or the tolerances may be too tight for this problem.