gistlib
main.mfunction dydt = myODE(t, y, x) dydt = zeros(2,1); dydt(1) = y(2); dydt(2) = 1000000*x - 1000000*y(1) - 1000*y(2); end 130 chars6 lines
function dydt = myODE(t, y, x) dydt = zeros(2,1); dydt(1) = y(2); dydt(2) = 1000000*x - 1000000*y(1) - 1000*y(2); end
You would then use this function myODE in an ODE solver like ode45 or ode15s to solve the differential equation.
myODE
ode45
ode15s
gistlibby LogSnag