Cummulative numerical integral using integral function

1 vue (au cours des 30 derniers jours)
mrish
mrish le 29 Jan 2020
Hey all,
I want to calculate cummulative numeric integral using integral function (or quad function in old matlab version) and compare to results with cumtrapz.
However, this function don't work with vectors!
I want to do:
g(i) = integral((x)@myfunc,0,h(i)) where h=1:600e3.
note the function is the same in every case - this is not a function array.
I implemented it with a for loop but it takes a very long time and this is just one of the calculations I need to do...
Is there a more 'vectorial' way to implement it?
thanks in advance!

Réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by