How do I go about plotting the following function?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
The function I want to plot is x[n] = \delta[n] - \delta[n-a] where a is just a number.
I know about plotting the impulse function on it's own but this doesn't make any sense to me.
Any and all help is appreciated.
Antworten (1)
John Doe
am 9 Okt. 2019
Bearbeitet: John Doe
am 10 Okt. 2019
I've used random numbers.
a = 5
n = [1:1:50]';
delta = 10;
x(n,1) = delta - (delta*(n-a))
plot(x,n)
Alternatively, you could leave n as it is without transposing and plot per the below:
a = 5
n = 1:1:50;
delta = 10;
x(n,1) = delta - (delta*(n-a))
plot(x(:,1),n(1,:))
It doesn't make much odds.
Siehe auch
Kategorien
Mehr zu Formatting and Annotation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!