How to integrate this double integral?
Afficher commentaires plus anciens
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!
Réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!