MATLAB: How to fsum on only one variable

sum

Hi, I want to find the following Z(i)s but inside the sum is only for j. How can I write following script with sum on only j? Sorry if my question is very basic stuff
for i=1:n
for j=1:m
Z(i)=Z(i)-sum(S(j).*Z(i-j))
end
end

Best Answer

H=filter([1,-S],0 , Z);