Is it correct? (dirac delta function)
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MINJEONG PARK
le 19 Avr 2020
Réponse apportée : Walter Roberson
le 19 Avr 2020
Hi. I want to stem this function,

and this is my code.

i wonder it is correct.
0 commentaires
Réponse acceptée
Walter Roberson
le 19 Avr 2020
no it should be 2*(n==0)
However there is another sense in which dirac(x) should be infinite when x is 0 instead being 1.
0 commentaires
Plus de réponses (1)
Ameer Hamza
le 19 Avr 2020
You code is correct. Another way is to use built-in kroneckerDelta function.
n = sym(-5:5);
xn = kroneckerDelta(n,-2) - 2*kroneckerDelta(n,0) + kroneckerDelta(n,2);
stem(n, xn, 'b', 'filled')
axis([-10 10 -5 5])
0 commentaires
Voir également
Catégories
En savoir plus sur Surrogate Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!