How I can write this in MATLAB ?

Hi guys , Please How I can write
x[n]=3(-1/4)^n u[n] , 1 n ≤ 20 in matlab..

 Accepted Answer

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

2 Comments

Thanks Sir ,, But how I can write this x1[n] = u[n-5] ,1 ≤ n ≤ 10
n=1:10
x1=heaviside(n-5)+0.5*not(n-5)

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!