how to plot a function consisting of sum of dirac deltas?

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
Bjorn Gustavsson le 6 Mai 2020
Have a look at stem, it does somewhat "representing Dirac'ses", maybe it is good enough?
HTH

9 commentaires

Im using a contineous time signal
I think stem work better for descrete
how i can use stem with it?
The xline function is another option.
im using convolation of x(t) and another function
xline didnt work for it
Musab, can you show an example image of the type of graph you want?
You can make it with stem()
stem([-4 -2 0 2 4], [1 1 1 1 1], 'filled', ...
'LineWidth', 2)
xlim([-5 5])
thank you very much
but bro im looking forward to use x(t) to plot it
Musab Labeeb
Musab Labeeb le 6 Mai 2020
Modifié(e) : Musab Labeeb le 6 Mai 2020
can you help me to plot this function. i try to find its slope and try to plot it but it become 0

Connectez-vous pour commenter.

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!

Translated by