what is the problem here..?
syms x;
a=1.5;
b=0.5;
fun=@(x) (x-b).^2*exp.^(-x);
value=integral(fun,0,a)
IT says Error: integral (line 88) Q = integralCalc(fun,a,b,opstruct);
Error: c (line 7) value=integral(fun,0,a)
Thanks for the advice in advance

 채택된 답변

Ameer Hamza
Ameer Hamza 2018년 6월 1일

0 개 추천

When using integral(), you don't need to use sym. Also exp is defined as a function in MATLAB, not a constant. Compare your code with the following code to find the mistakes
a=1.5;
b=0.5;
fun = @(x) (x-b).^2.*exp(-x);
value=integral(fun,0,a)

댓글 수: 1

JI Yong Song
JI Yong Song 2018년 6월 1일
편집: Rik 2021년 2월 14일
Why did i put a ^ there? That was so stupid

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

추가 답변 (0개)

카테고리

제품

태그

질문:

2018년 6월 1일

편집:

Rik
2021년 2월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by