function out=lorenz(t,xyz,p)
%Lorenz equations are given here

%written kinda clumsily so it's easier
%to see what's going on. Can be done with fewer lines.
x=xyz(1);
y=xyz(2);
z=xyz(3);

dxdt=p.sigma*(y-x);
dydt=p.r*x-y-x*z;
dzdt=x*y-p.b*z;

out=[dxdt;dydt;dzdt];