compute numerical integral by matlab

조회 수: 1 (최근 30일)
reem
reem 2011년 4월 7일
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