function dxdt = complex1(t,x) NN=50; w=8; for n=1:NN, V(n)=0; end for n=NN/2-1:NN/2+1, V(n)=1; end dxdt(1)=(w*i*(x(2)-2*x(1))-i*V(1)*x(1))'; for I=2:NN-1, dxdt(I)=(w*i*(x(I+1)+x(I-1)-2*x(I))-i*V(I)*x(I))'; end dxdt(NN)=(w*i*(x(NN-1)-2*x(NN))-i*V(NN)*x(NN))'; dxdt = dxdt';