Cummulative numerical integral using integral function

1 Ansicht (letzte 30 Tage)
mrish
mrish am 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!

Antworten (0)

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by