How to integrate this double integral?

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개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2013년 8월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by