Error using quad for nummerical integration

I am unable to understand why i cant use the quad function for nummerical integration..
tk = 1.5;
Assymptotisk=@(x) sqrt(2/pi)*1/sqrt(x)*exp(-x);
vc= quad(Assymptotisk,tk,inf);
The above code reproduces the problem in my main program..
Thanks in advance!

 채택된 답변

Pedro Villena
Pedro Villena 2012년 10월 29일

0 개 추천

this equation has a singularity to Inf
tk = 1.5;
Assymptotisk=@(x) sqrt(2/pi).*exp(-x)./sqrt(x);
vc= quad(Assymptotisk,tk,1e18);

댓글 수: 2

You were right, i looked at my problem again and it turns out i was using the wrong function :)
Thanks
quadgk(Assymptotisk,tk,inf);
integral(Assymptotisk,tk,inf);% with MATLAB R2012a

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by