You are on page 1of 1

clear all; close all; clc

load dataerick.lvm
% T=1000;
t=dataerick(:,1); % tiempo
y1=dataerick(:,2); % Respuesta
u1=dataerick(:,4); % Estimulo
dt=t(34)-t(33); %delta de tiempo
fs=1/dt;%frecencia de muetreo(HZ)

data=iddata(y1,u1,dt);
th=armax(data,[2 1 1 1]);
thc=d2c(th);
[nc,dc]=th2tf(thc);
fprintf('Funcion Tranferencia por modelo-armax')
F=tf(nc,dc)
A=lsim(F,u1,t);

plot(t,u1,'b')
hold
plot(t,y1,'r')
plot(t,A,'g')

You might also like