% solve Lorenz equations using ode45
xini = [-8 8 27];
[t, x] = ode45(@lorenz,[0 20],xini);
plot(t,x)

% now change initial conditions slightly
% and compare new x(1) to old x(1)
xini = [-8.01 8 27];
[t2, x2] = ode45(@lorenz,[0 20],xini);
plot(t,x(:,1),t2,x2(:,1))

% now go back to first set of initial 
% conditions, but use ode23
xini = [-8 8 27];
[t3, x3] = ode23(@lorenz,[0 20],xini);
plot(t,x(:,1),t3,x3(:,1))


% now supply parameters externally
[t, x] = ode45(@lorenz2,[0 20],xini,[],10,28,8/3);
plot(t,x)