Code covered by the BSD License  

Highlights from
Fireworks GUI

image thumbnail

Fireworks GUI

by

 

30 Dec 2010 (Updated )

Enjoy some fireworks (with sound) with this interactive GUI

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

odeFcn(t, Y, m, b, g)
function dY = odeFcn(t, Y, m, b, g)

% Author: Jiro Doke
% Date: Dec 28, 2010
% Copyright 2010-2012 The MathWorks, Inc.

if nargin == 4
    g = 9.81;
end
xdot = Y(2);
ydot = Y(4);
% th = atan2(ydot, xdot);

f = thrust(t);

dY(1, 1) = Y(2);
% dY(2, 1) = f/m*cos(th) - b/m*xdot;
dY(2, 1) = - b/m*xdot;
dY(3, 1) = Y(4);
% dY(4, 1) = -g + f/m*sin(th) - b/m*ydot;
dY(4, 1) = -g + f/m - b/m*ydot;

end

function f = thrust(t)

f = 0*t;

end

Contact us