Can fploy and ezplot a discrete time signal?

6 visualizaciones (últimos 30 días)
Jinquan Li
Jinquan Li el 15 de Feb. de 2021
Respondida: Walter Roberson el 15 de Feb. de 2021
I'm trying to plot a discrete time signal : y[n] = 5𝛿(n)+3u(n-3) , for n=[-1:0.01:10] by using fplot or ezplot.
Here's what I've tried but the result seems not correct.
n = [-1:0.01:10];
y = 5*dirac(n) + 3*heaviside(n-3);
fplot(y)
grid on
xlabel('t (time)');
ylabel('[y5(t)]');

Respuestas (1)

Walter Roberson
Walter Roberson el 15 de Feb. de 2021
No. fplot and ezplot are for function handles or symbolic expressions or symbolic functions. They treat numbers as if they were a formula that returned that number.
Use a different plotting function such as stairs or stem

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by