MATLAB Answers

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

3 views (last 30 days)
Lorenzo Ledda
Lorenzo Ledda on 28 May 2020
Answered: Ameer Hamza on 28 May 2020
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.

  0 Comments

Sign in to comment.

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

  0 Comments

Sign in to comment.

More Answers (0)

Tags