## Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1495
Number of posts: 2175

This Forum Only

matlab help needed urgently!! regarding length of equation. Posted by lyncheong on 1 Nov 2012 at 1:03 PM
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?

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic