function saida=ident(ent)

% Controle Adaptativo
% 3o. exercicio

% condicoes iniciais

load cond;

% identificador

fi=[ent(5) ; ent(4) ; ent(2) ; ent(1) ];

e=ent(6)-fi'*thetac; % fi1, thetac1

p=p - ( p*fi*fi'*p )/( 1+fi'*p*fi );

thetac=thetac + p*fi*e;

save cond thetac p fi

saida=[thetac ; e];
