How to plot signal with unit step?

Illustration
Bilal Siddiqui - 2023-11-03T09:53:58+00:00
Question: How to plot signal with unit step?

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  

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

You can use heaviside function:

 n = -5:1:20;
 x = ((4/5).^n).*heaviside(n);
 stem(n,x)

Bet be aware heaviside(0)=0.5


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!