using convolution with matlab

x[n]=n^3-n^2, 0<n<3
h[n]=1/n, -2<n<-1
y[n] is the convolution of x[n] and h[n]
how can i compute y[n] ?

 Accepted Answer

With all due respect, I think you need to take some time to read the MATLAB documentation.
n = 0:3;
x=n.^3-n.^2;
m=[-2:-1];
h=1./m;
y = conv(x,h)

3 Comments

i did try, but i am not a good learner somehow...
anyway, thanks for ur kind replies. it really helps a lot!
You should accept people's answers if they help you.
ok, just done!

Sign in to comment.

More Answers (1)

Wayne King
Wayne King on 21 Sep 2012
Use the function conv()
See the help for conv()

1 Comment

ive tried, but it does not work at all.
n=[0:3];
x=n^3-n^2
m=[-2:-1];
h=1/m
y= conv(x,h)
no results at all, could u help?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!