clc
clear
abar=input('Masukkan tebakan awal= ');
fi=input('Sudut fasa berapa pi?');
dt=input('dt= ');
ta=input('serta ta= ');
a1(1)=abar;
a=1;
t=0:dt:ta;
n=length(t);
for i=1:(n-1)
   home
   k=i
   clc
   ab=a1(i);
   x(i)=sin(a*t(i));
   x1(i)=sin(ab*t(i)+fi*pi);
   e(i)=abs(x(i))-abs(x1(i));
   a1(i+1)=a1(i);
end;
x(n)=sin(a*t(n));
ab=a1(n);
x1(n)=sin(ab*t(n)+fi*pi);
e(n)=abs(x(n))-abs(x1(n));
plot(t,x);
pause
clf
plot(t,x1);
pause
clf
plot(t,e);
