doesnt make any sense plot (RLS) !!

조회 수: 1 (최근 30일)
Marwa  Ali
Marwa Ali 2012년 4월 27일
original system:
y(k)=2.7*y(k-1)-1.8*y(k-2)+u(k-1)+5*u(k-2)+6*u(k-3);
it's required to get the parameters using recursive extended least square..so my code is:
%Recursive Extended Least square
u=ScopeData2(:,2);
P=1000*eye(4);
theta=[0 0 0 0]';
y=zeros(500,1);
for k=4:500
y(k)=2.7*y(k-1)-1.8*y(k-2)+u(k-1)+5*u(k-2)+6*u(k-3);
phai=[y(k-1) -y(k-2) u(k-2) u(k-3)]';
P=P-((P*phai*phai')*inv(1+(phai'*P*phai)));
e(k)=y(k,1)-phai'*theta(k-1);
theta=theta+P*phai*e(k);
a1(k)=theta(1);
a2(k)=theta(2);
b1(k)=theta(3);
b2(k)=theta(4);
end
when i run program and plot values of a1,a2,b1,b2..it gives me NAN instead of converges to their true values :S
any help would be greaaaat .
A
  댓글 수: 1
Marwa  Ali
Marwa Ali 2012년 4월 27일
u is input signal ...i used square wave!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 View Data During Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by