Vous êtes sur la page 1sur 2

The Structure of an ODE Function

The ODE function is a MATLAB function that represents the ODE for use in a MATLAB ODE solver,
like ode45.
The ODE function has two main parts, the function declaration and the function body. The function ends
with the keyword end.

Function Declaration
The function declaration always begins with the keyword function.
Function Body

The body of the function contains the code that defines the ODE to be solved.

The ODE should be written so the derivative is on the left side of the equals sign and everything else is
on the right side. Be sure to assign it to the same output variable from the function declaration.

Vous aimerez peut-être aussi