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