MATLAB: Integration problem, getting wrong answer in matlab

exponentialintegral

Good morning I have an integration that I need to compute, I used MATLAB but I did not get the right answer.
This is the integral:
exp(-(t-1)^2/(σ^2)) dt
from -Inf to Inf. I am getting that it equals zero which is impossible, can any one help me?
Thank you in advance

Best Answer

How are you doing the integration?
>> sigma = 7
sigma =
7
>> syms t
>> exp(-(t-1)^2/(sigma^2))
ans =
exp(-(t - 1)^2/49)
>> int(ans,t,-inf,inf)
ans =
7*pi^(1/2)