clear all; %y(t+2) + y(t+1) - 2y(t) = 12, t>0 %y(1) = 4, y(2) = 5 t=[1:30]; y(1) = 4; y(2) = 5; for m=3:30; y(m)=-y(m-1)+2*y(m-2)+12; end plot(t,y,'*') xlabel ('tempo') ylabel ('y') title ('Trajetória obtida no Matlab (*)') pause ayte(1)=4; ayte(2)=5; for i = 2:29 yte(i)=3+(-2)^(i)+4*(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)')