Is it correct? (dirac delta function)
Mostra commenti meno recenti
Hi. I want to stem this function,

and this is my code.

i wonder it is correct.
Risposta accettata
Più risposte (1)
Ameer Hamza
il 19 Apr 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])
Categorie
Scopri di più su Surrogate Optimization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!