The loop just goes through each time point in the signal adding in a fraction of the signal from an earlier time point.
Attach your code as an m-file with the paper clip icon if you need more help so people can run it.

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