infinite integration with matlab

拟墨画扇 提交于 2019-11-30 19:11:57

问题


I want to compute the following type of integrals in Matlab.

It is the integral of function e^-(u)*u and the boundaries are zero and infinity. This integral should return 1.

How can I do this in Matlab?


回答1:


And if you don't have the symbolic toolbox, or want more speed, quadgk supports infinite limits:

f = @(x) x.*exp(-x);
a = quadgk(f, 0, inf) 

a =
    1.000000000000000e+00



回答2:


Symbolic toolbox.

syms u
int(exp(-u)*u, u, 0, inf)


来源:https://stackoverflow.com/questions/11839394/infinite-integration-with-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!