I want to make a FIR filter. I have an array of coefficients n2 and an array of data n1 but without using inbuilt function (fir) in octave. i am not sure what is the problem here.

I am getting an error while running this code. error: y(0): subscripts must be either integers 1 to (2^31)-1 or logicals error: called from fir1 at line 12 column 10

```
`n1=input('enter length of random sequence');
n2=input('enter length of filter');
for i=1:n1
x(i)=input('elements of x')
end
for i=1:n2
y(i)=input('elements of y')
end
c=zeros(1,(n1+n2));
for i=1:(n1+n2)
for j=1:n2
c(i)=c(i)+x(j)*y(i-j+1);
end
end
c`
```

thank you so much.. I figured it out.. I tried the following code for the problem.