matlab help needed urgently!! regarding length of equation. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

matlab help needed urgently!! regarding length of equation.

lyncheonglyncheong Posts: 2Member
Hey guys, I urgently need help on my codes. I'm suppose to create a code where the output sequence y(n) is the same as the length of the input sequence x(n)

yy(7:length(x)+6)=0;
x=[1 0 0 0 0 0 0];
N=length(x);
xx(7:length(x)+6)=x;
yy(7:length(x)+6)=0;
for n=7:length(x)+6
yy(n)=0.0011*xx(n)+0.00632*xx(n-1)+0.00158*xx(n-2)+0.0210*xx(n-3)+0.0158*xx(n-4)+0.0063*xx(n-5)+0.0011*xx(n-6)+2.9785*yy(n-1)-4.1361*yy(n-2)+3.2598*yy(n-3)-1.5173*yy(n-4)+0.3911*yy(n-5)-0.0434*yy(n-6);
end
y=yy(7:length(x)+6);

but when i continued on with
N=1024;
n=1:N;
w=(2*pi*n/N);
d= zeros(1,N);
d(1)=1;
>> x=d;
>> stem(n,y)

i got an error code saying
??? Error using ==> stem at 44
X must be same length as Y.

how do i fix this problem?
Sign In or Register to comment.