Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1471
Number of posts: 2147

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
matlab help needed urgently!! regarding length of equation. Posted by lyncheong on 1 Nov 2012 at 1:05 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
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.