How to plot signal with unit step?

140 views (last 30 days)
Bilal  Siddiqui
Bilal Siddiqui on 15 Sep 2015
Answered: Kamalika Saha on 5 Jan 2022
I want to plot the following signal in matlab but I am not sure how to do this with the unit step response involved.
x[n] = ((4/5)^n)u[n]
-5 < n < 20

Accepted Answer

Hamoon on 15 Sep 2015
You can use heaviside function:
n = -5:1:20;
x = ((4/5).^n).*heaviside(n);
Bet be aware heaviside(0)=0.5

Sign in to comment.

More Answers (1)

Kamalika Saha
Kamalika Saha on 5 Jan 2022
n = -5:1:20;
x = ((4/5).^n).*heaviside(n);

Community Treasure Hunt

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

Start Hunting!