Ejempki Actividad II Parte 2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

% ejempki actividad II parte 1

% inciso a)
t=0:0.1:30;
x=5-5.*exp(-t)-5.*t.*exp(-t);
m=1;b=2;k=1;
n=1;d=[m b k];
g=tf(n,d);
figure(4)
step(5*g),hold on,plot(t,x,'g'),legend('Respuesta de G(s)','Respuesta de
x(t)'),xlabel('Tiempo[s]'),ylabel('Desplazamiento[m]'),grid,hold off
% inciso b)
x=0.1.*t.*exp(-t);
figure(5)
plot(t,x),xlabel('Tiempo[s]'),ylabel('Desplazamiento[m]'),grid

% inciso c)
x=-2+t+2.*exp(-t)+t.*exp(-t);
figure(6)
n=1;d=[m b k 0];
g=tf(n,d);
step(g),hold on,plot(t,x,'r'),axis([-inf 30 -inf
35]),xlabel('Tiempo[s]'),ylabel('Desplazamiento[m]'),grid

You might also like