function logisticode

%parameters
a=1;
K=1;
%intervals of time which to run the model
tspan=[0 10];
%the initial condition for susceptible and infected
x0=0.01;

[t,x]=ode45(@f,tspan,x0);

plot(t,x(:,1),'linewidth',2);
xlabel('time');
ylabel('population');

%plot(x(:,1),x(:,2));

%plot(x(:,1),x(:,2),'linewidth',2);
%xlabel('susceptible');
%ylabel('infected');

function dxdt=f(t,x)
dxdt=[a*x(1)*(1-x(1)/K)];
end
end