Clear Filters
Clear Filters

๐‘ฅ [๐‘›] = ๐‘ข[๐‘›]๐‘’^โˆ’๐‘› how to plot it

3 views (last 30 days)
Mohammed Alqahtany
Mohammed Alqahtany on 19 Oct 2023
Commented: Sam Chak on 19 Oct 2023
๐‘ฅ[๐‘›] = ๐‘ข[๐‘›]๐‘’^โˆ’๐‘›

Answers (1)

akshatsood
akshatsood on 19 Oct 2023
Edited: akshatsood on 19 Oct 2023
Hi Mohammed,
I understand that you want to plot the following discrete equation.This can be achieved by leveraging the "stem" function which is used for plotting discrete sequence data.
n = (-20:20); % defining range of n
u_n = (n>=0); % unit step function
tiledlayout(3,1);
nexttile; % u[n]
stem(n,u_n);
nexttile; % e^-n
stem(n,exp(-n));
nexttile; % u[n]*e^-n
stem(n,u_n.*exp(-n));
For more information about the "stem" function, have a look at the following reference
I hope this helps

Tags

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!