How to integrate this double integral?

1 view (last 30 days)
NineNein
NineNein on 22 Aug 2013
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!

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!