how to plot a function consisting of sum of dirac deltas?
Afficher commentaires plus anciens
Hello,
Can anyone help me to plot x(t) = dirac(t+4)+dirac(t+2)+dirac(t)+dirac(t-2)+dirac(t-4). I'm trying to plot vertical lines on t=-4,-2,0,2,4. but it is giving a single vertical line with length -5 to 5 at t=0.
Réponses (2)
Bjorn Gustavsson
le 6 Mai 2020
1 vote
Have a look at stem, it does somewhat "representing Dirac'ses", maybe it is good enough?
HTH
9 commentaires
Musab Labeeb
le 6 Mai 2020
Musab Labeeb
le 6 Mai 2020
Star Strider
le 6 Mai 2020
Musab Labeeb
le 6 Mai 2020
Ameer Hamza
le 6 Mai 2020
Musab, can you show an example image of the type of graph you want?
Musab Labeeb
le 6 Mai 2020
Ameer Hamza
le 6 Mai 2020
Modifié(e) : Ameer Hamza
le 6 Mai 2020
You can make it with stem()
stem([-4 -2 0 2 4], [1 1 1 1 1], 'filled', ...
'LineWidth', 2)
xlim([-5 5])

Musab Labeeb
le 6 Mai 2020
Musab Labeeb
le 6 Mai 2020
Modifié(e) : Musab Labeeb
le 6 Mai 2020
Musab Labeeb
le 6 Mai 2020
0 votes
Catégories
En savoir plus sur Color and Styling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!