Is there a way to make dirac delta function be 1 at the origin?

32 views (last 30 days)
Hi. I'm having some issues with delta function. I need to use symbolic variables and functions which I need to differentiate. Since some heaviside functions are present in my main function, its differentiation brings me delta functions. I need them to give 1 if the delta argument is zero, but I obtain infinite. Is there a way to avoid this (maybe with a different differentation matlab function)? I use the diff() function to differentiate my sym function.

Accepted Answer

Ameer Hamza
Ameer Hamza on 28 May 2020
Replace dirac with kroneckerDelta
syms x
f(x) = heaviside(x);
g(x) = diff(f);
Result
>> g(0)
ans =
Inf
Now run
g(x) = subs(g, dirac(x), kroneckerDelta(x));
Result
>> g(0)
ans =
1

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!