compute numerical integral by matlab

1 次查看(过去 30 天)
Hello everybody Please,I want to know,how compute integral from 2 to infinity for any function using matlab? thanks in advance

采纳的回答

Matt Fig
Matt Fig 2011-4-7
Put the function in an anonymous function, then use QUADGK.
  3 个评论
Matt Fig
Matt Fig 2011-4-7
Don't put the keyword: function in a script or at the command line. Just do this:
y=@(X)(1/sqrt(2*pi))*exp(-0.5*X.^2); % Anonymous func.
Q=quadgk(y,2,inf)
reem
reem 2011-4-7
Thank you so so so much
you are very kind and smart
I hope all best things for you
Kind regards

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by