difference results from int and integral of delta function

Hello Matlab experts:
I am trying to calculate the integral of delta function, however I got two different answers. apparently answer 0 is wrong. Can anyone explain the difference for me?
really appreciate.
Regards
Method 1:
>> int(dirac(x), -inf, inf)
ans =
1
Method 2:
>> delta_fun = @(t) dirac(t);
>> integral(delta_fun, -inf, inf)
ans =
0
>> delta_fun(0)
ans =
Inf

1 commentaire

In method 2 you are trying to do numeric integration on a symbolic function.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by