%%Solve differential equation
clf reset;

F='[-i*exp(i*t)*y(2);-i*exp(-i*t)*y(1)]';

func=inline(F,'t','y');
[t,y]=ode23(func,[0.01,100],[0,1]);


plot(t,imag(y));
%%Test solution
hold on;

t1=0:0.01:100;
c2=-i*exp(-i*t1./2).*sin(sqrt(5/4).*t1);
c1=(-i/(2*sqrt(5/4)).*sin(sqrt(5/4).*t1)+cos(sqrt(5/4).*t1)).*exp(-i.*t1/2);

plot(t1,imag(c2),'r');
plot(t1,imag(c1),'black');
