clear all; clear t; %y(t+2) + 6y(t+1) + 9y(t) = 4, t>0 %y(0) = 1.25, y(1) = -6 t=[1:40]; y(1) = 1.25; y(2) = -6; for m=3:40; y(m)=-6*y(m-1)-9*y(m-2)+4; end plot(t,y,'*') xlabel ('tempo') ylabel ('y') title ('Trajetória obtida no Matlab (*)') pause ayte(1)=1.25; ayte(2)=-6; for i = 2:39 yte(i)=0.25+(-3)^(i)+i*(-3)^(i); ayte(i+1)=yte(i); end plot(t,ayte,'o') xlabel ('tempo') ylabel ('y') title ('Trajetória teórica (o)') pause plot(t,y,'*',t,ayte, 'o') xlabel ('tempo') ylabel ('y') title ('Trajetória obtida no Matlab (*) e teórica (o)')