How can I fix the that error?
Afficher commentaires plus anciens
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;
Réponses (2)
madhan ravi
le 31 Oct 2018
0 votes
Size of th is 500by 4 and size of phi is 5 by 1 how can you add them??
1 commentaire
madhan ravi
le 31 Oct 2018
lot of bugs first you need to explain your desired result with short example
KSSV
le 31 Oct 2018
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)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!