b=0.5;c=0.5;

figure(1);
[x,y]=meshgrid(-10:0.2:10,-6:0.2:6);
xp=f(x,y);yp=g(x,y,b,c);
%L=1;
L=sqrt(xp.^2+yp.^2);
quiver(x,y,xp./L,yp./L);
hold on;
axis([-9 9 -4 4]);

[t,Y]=ode45(@(t,Y)[f(Y(1),Y(2)); g(Y(1),Y(2),b,c)],[0 100],[-6,4]);
plot(Y(:,1),Y(:,2),'LineWidth',1);
hold off;

figure(2);
plot(t, Y);
hold off;


function z=f(x,y)
z=y;
end

function z=g(x,y,b,c)
z=-b*y-c*sin(x);
end



