solving integral equations by integral

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