numerical integration __ integral limits being variables
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Star Strider
2015-4-5
1 个投票
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 个评论
Meva
2015-4-5
Star Strider
2015-4-5
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!