How can I fix the that error?
이전 댓글 표시
t=[0:0.1:5];
f=1;
n=2;
w=2*pi*f;
x1=cos(w*t);
e=2*pi*x1;
syms x1
int(x1,0,5);
phi=(1/2);
Lam=n*phi;
답변 (2개)
madhan ravi
2018년 10월 31일
0 개 추천
Size of th is 500by 4 and size of phi is 5 by 1 how can you add them??
댓글 수: 1
madhan ravi
2018년 10월 31일
lot of bugs first you need to explain your desired result with short example
KSSV
2018년 10월 31일
Though the error is solved..you need to check your code...
close all;
th=[1 1 1 1]';
u(1)=1; y(1)=1; y(2)=1;
mu=1;
r(1)=10;
N=500;
th=zeros(4,N);
for k=2:N
r(k)=10;
ym(k+1)=0.4*y(k)+0.6*r(k);
u(k)=(1/th(1,k))*(-th(2,k)*u(k-1)-th(3,k)*y(k)-th(4,k)*y(k-1)+0.6*r(k));
y(k+1)=1.7*y(k)-0.7*y(k-1)+2*u(k)+0.6*u(k-1);
e(k+1)=y(k+1)-ym(k+1);
phi=[u(k) u(k-1) y(k) y(k-1)]';
th(:,k+1)=th(:,k)+mu*phi*e(k+1)./(1+phi'*phi);
end
plot(ym)
plot(r)
plot(u)
plot(y)
plot(th)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!