可以详细讲讲每行都干了点什么吗?% Evaluating an LCCDE algorithmically% y[n] + y[n-1] - 6y[n-2] = x[n]% with y[-2] = -1, y[-1] = 1, x[n] = 8.u[n]% Calculate for n = 0..4, but include -2 and -1nn = -2:4;% So setup initial y values; zero is index 3zz = 3;y(zz+ -2) = -1;y(zz+ -1) = 1;% Now evaluate the LCCDE step by stepx = zeros(1,7);x(zz+ [0:4]) = 8;for n = 0:4; y(zz+ n) = x(zz+ n) - y(zz+ n-1) + 6*y(zz+ n-2); endy% y =% -1 1 1 13 1 85 -71
|