function [t,y] = oscil(delta);
tspan=[0,7];

init=[1;0];
%delta=3;
omega=10;
[t,y]=ode45(@f,tspan,init);
plot(y(:,1),y(:,2));


%Of course, we must annotate the plot.
xlabel('displacement [m]');
ylabel('velocity [m/s]');
title('A damped harmonic oscillator');
axis([-1 1 -10 10]);
grid on;


function yprime=f(t,y);
yprime=zeros(2,1);
yprime(1)=y(2);
yprime(2)=-2*delta*y(2)-omega^2*y(1);
end
clc
end