How to integrate this double integral?
1 view (last 30 days)
Show older comments
Hi, i try to integrate: Int( dy Int(dx G(x), t0, y), t0, t). Where G(x) is a function which accepts a vector, also t is a vector. y is depending on the outer integral. I tried it with trapez ( the integral value have not 100% exact) but it is too slow :(. Any suggestions how this integral can be implemented efficiently.
Here my slow code:
for j = 2:length(t)
Xj = t(1:j);
Yj = zeros(size(Xj));
for j = 1:length(Yj)
Yj(j) = trapz(1:Xj(j),G(1:Xj(j)));
end
y(j) = trapz(Xj,Yj);
end
Thank you!
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!