it's my code:
clear all;N=1000;a1=-1.7559760050623385;a2=0.82149794841686108;b0=1;b1=-0.83683008015976024;b2=1;coeff=0.039878940119824811;x=sin(2*pi*(N-1))/N*3;z0=0;z1=0;z2=0;for n=1:N z2=z1; z1=z0; z0=x(n)-a1*z1-a2*z2; y(n)=(b0*z0+b1*z1+b2*z2)*coeff;endfigure(1);plot(x);figure(2);plot(y);
An error
Attempted to access x(2); index out of boundsbecause numel(x)=1.Error in ==> Untitled at 20 z0=x(n)-a1*z1-a2*z2;
How to solve a problem?
Best Answer