필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I am getting error in this code?

조회 수: 1 (최근 30일)
rajasekhar reddy ogirala
rajasekhar reddy ogirala 2014년 2월 14일
마감: MATLAB Answer Bot 2021년 8월 20일
f=@(x)cos(x)/x q(x)=integral(f,0,10)
i am getting error in evaluating that statements in command window
sorry guys i am very new to MATLAB.
Thanks for ur help

답변 (1개)

Mischa Kim
Mischa Kim 2014년 2월 14일
편집: Mischa Kim 2014년 2월 14일
Rajasekhar, use
f = @(x) cos(x)./x;
q = integral(f,0.1,10)
There is a problem though with f approaching inf as you approach x=0. So you can get close but not all the way.
  댓글 수: 2
rajasekhar reddy ogirala
rajasekhar reddy ogirala 2014년 2월 14일
thanks a lot,
Roger Stafford
Roger Stafford 2014년 2월 14일
Actually that integral is divergent at the lower limit of zero. As the lower limit, a, approaches zero, the integral approaches plus infinity in a similar way to -log(a).

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by