How to integrate this double integral?

1 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by