function output=logisticModel(x,param) 
%%% param vector is of the form growth rate and carrying capacity
%%% x vector is of the form y0, t0 and tEnd and number of timesteps

%%% output is the vector of y values

tspan = linspace(x(2), x(3),x(4));
y0 = x(1);

ode = @(t,y) logistic(t,y,param);
[t,y] = ode45(ode, tspan, y0);


output = y';


function yp = logistic(t,y,param);
%Simple logistic model

a = param(1);
K = param(2);

yp = a*y*(1-y./K);
