numerical integration __ integral limits being variables
Afficher commentaires plus anciens
Hello, I want to numerically integrate functions whose upper limits x, lower limits 0. Say;
int_0^x f(x) dx
Which method should I use. trapz, simpson, or omething else and which command ?
I mean can you send a simple example of doing this please? Thanks
Réponse acceptée
Plus de réponses (1)
Star Strider
le 5 Avr 2015
1 vote
If you are numerically integrating functions, use integral (or quad and its friends if you don’t have integral). You will obviously have to define what value ‘x’ is to do a numerical integration.
If you want to do a symbolic integration (and your function is integrable), use the Symbolic Math Toolbox int function.
3 commentaires
Meva
le 5 Avr 2015
Star Strider
le 5 Avr 2015
You can use cumtrapz with data returned by your function, but not with your function itself. If you want to use a function, you have to use integral or quad, as I wrote before.
Catégories
En savoir plus sur Numerical Integration and Differentiation 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!