% Parameter values for our ODE sigma = 10; beta = 8/3; rho = 28; y0 = [0 1 0]; % Initial conditions tspan = [-10 40]; % Time interval (doesn't have to start at zero) [t,y] = ode45('lorentz_rhs', tspan, y0, [], sigma, rho, beta); figure(1) plot(t,y(:,1),'b-',t,y(:,2),'g-',t,y(:,3),'r-'); legend('y_1','y_2','y_3','Location','Best') pause % Wait for the user to press a key % Plot the Lorentz Attractor (a.k.a. Lorentz Butterfly) figure(2) clf plot3(y(:,1),y(:,2),y(:,3),'b-') view(0,30) axis equal % Rotate the view az = 0; while 1 camorbit(3,0) % Move the camera 3 degrees around the scene camva(7) % Specify the view angle, for consistency pause(0.1) % Wait 0.1 seconds before continuing end