I'm attempting to solve a difference equation
y(k+1) = -0.5*y(k) + x(k)
where y(0) = 0 and x(k) is in my case a unit step function ie = 1
well, i'm trying to solve this using a for loop, but am having some trouble. The code i've generated gets an error, "Index into matrix is negative or...