How to plot digital sequence in MATLAB
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tommy P
il 24 Mag 2022
Commentato: Walter Roberson
il 25 Mag 2022
I have to plot following digital sequence in MATLAB: a^n * u[n]. a is just a constant. How do I do this?
Thanks
0 Commenti
Risposta accettata
David Hill
il 24 Mag 2022
n=1:length(u);
a=1.7;
plot(n,a.^n.*u);%assuming u is a vector
3 Commenti
Allen
il 24 Mag 2022
You can also plot this using a bar plot vs. a line plot.
bar(n,a.^n.*u)
Walter Roberson
il 25 Mag 2022
stem()
Note: u[n] is not a vector as such: it indicates the unit step function.
Più risposte (1)
Walter Roberson
il 24 Mag 2022
If you are certain that all of your values are finite, then you can replace u[n] by (n>=0)
If you have negative infinite values then it is not obvious that multiplying by the unit step function is well defined.
0 Commenti
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!