function [e,w,y]=lms(xa1,xa2,d);
w=zeros(2,1);
N=2;
M=2;
mu=0.005;
t=1:0.025:5;
s=5*sin(2*3.*t);
e=5*sin(2*50*3.*t);
u = [xa1 xa2] *error here error here error here*
xa1= sin(1.36*pi-pi/2);
xa2= -sin(1.36*pi);
d=s+e;
u=u(:);
d=d(:);
%LMS
for n=1:2
uvec=u(n:-1:1);
e(2)=d(n)-w'*uvec;
w=w+mu*uvec*conj(e(n));
end
e=e(:);
think you very much for help

댓글 수: 1

the cyclist
the cyclist 2017년 4월 9일
Please provide an example of the inputs to lms that will result in the error.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2017년 4월 9일

1 개 추천

Posting the complete error message and the calling command would reveal the problem. I guess:
Either "xa1" or "xa2" is a function handles. Then u = [xa1 xa2] would require input arguments for the function.
It looks strange, that you overwrite the values in the next lines:
u = [xa1 xa2] *error here error here error here*
xa1 = sin(1.36*pi-pi/2);
xa2 = -sin(1.36*pi);

카테고리

도움말 센터 및 File Exchange에서 Debugging and Improving Code에 대해 자세히 알아보기

질문:

2017년 4월 9일

댓글:

2017년 4월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by