%programa preparacion datos toolbox ident respuesta escalon %apertura %valvula_Ts ws=input('Introduce workspace \n','s'); open(ws) Tst=ans.Ts'; Irrt=ans.Irr'; VM1t=ans.VM1'; ident; h=msgbox('Para continuar el programa, tras ejecutar ident, debe cerrar esta ventana'); waitfor(h); sysident=ans; sys=tf(sysident); Ts_VM1=step(sys(:,1,:)); t=length(Ts_VM1); for x=1:1:t; Ts(x)=Ts_VM1(x); VM1(x)=ones(1); end T_muestreo=1; %Tiempo de muestreo con el que se han sacado los datos con CubeDDE V1=VM1(1); x=1:1:t; %for i=1:t % if (VM1(i)==V1) % nescalon=i; %end % VM1(i)=VM1(i)+30; %end Tfinal=Ts(t); Tinicial=Ts(1); T5ciento=((Tfinal-Tinicial)*0.05)+Tinicial; T63ciento=((Tfinal-Tinicial)*0.63)+Tinicial; %plot(x,Ts(x),'',x,VM1(x),'')%,x,T5ciento,'',x,T63ciento); %AXIS([0 1800 60 110]);legend('Tsc','VM1'); T5diferencia=abs(Ts(1)-T5ciento); T5diferencia2=T5diferencia; for i=2:1:t; T5diferencia=abs(Ts(i)-T5ciento); if (T5diferencia2>T5diferencia); T5diferencia2=T5diferencia; tiempo5=i*T_muestreo; end end T63diferencia=abs(Ts(1)-T63ciento); T63diferencia2=T63diferencia; for i=2:1:t; T63diferencia=abs(Ts(i)-T63ciento); if (T63diferencia2>T63diferencia) T63diferencia2=T63diferencia; tiempo63=i*T_muestreo; end end k=(Tfinal-Tinicial)/1 tau=(tiempo63-tiempo5) retraso=(tiempo5-(0*T_muestreo)) save ws&simIrr.mat