Integration over function between two limits
조회 수: 28 (최근 30일)
이전 댓글 표시
format compact
syms x
f(x) = sin(x)
q = integral(f(x),0,pi)
when I run this I am facing the following error :
"Error using integral (line 82)
First input argument must be a function handle.
Error in integ (line 4)
q = integral(f(x),0,pi) "
Could you please explain why i am unable to put f(x) as a first input argument in the integral after defining the variable x.
댓글 수: 0
답변 (2개)
Walter Roberson
2019년 12월 3일
integral() is used only for numeric integration.
For symbolic integration, use int() if you want to see the closed form solution (if it exists), or use vpaintegral() for symbolic numeric solutions.
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!