% Lorenz equation simulation
% Muthuswamy, Bharathwaj
% muthuswamy@msoe.edu
% MSOE IEEE Talk, December 17th 2010

close all;
clear;
% setup equation using ode45 (including parameters) and solve
% w = [x;y;z]
lorenzEquations = inline('[-10*w(1)+10*w(2);28*w(1)-w(2)-w(1)*w(3);-(8/3)*w(3)+w(1)*w(2)]','t','w');
options = odeset('RelTol',1e-5,'AbsTol',1e-5);
[t,w] = ode45(lorenzEquations,[0 100],[10 20 30],options);
% plot
plot3(w(:,1),w(:,2),w(:,3));
% label using MATLAB figure tools