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

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 1 de Jun. de 2018
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 comentario

JI Yong Song
JI Yong Song el 1 de Jun. de 2018
Editada: Rik el 14 de Feb. de 2021
Why did i put a ^ there? That was so stupid

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Etiquetas

Preguntada:

el 1 de Jun. de 2018

Editada:

Rik
el 14 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by