When you pass your function into ode45, you are passing it in as a function_handle. This allowes ode45 to assign its own name to some instance of your function, which in my example I called f. If you already know how to do the integration and want to create a function like ode45, you will need to use function_handles.
This might help:
Function Handles (Programming and Data Types)
You are essentially createing a function_handle when you write
Code:
@mydifferentialequation
Maybe I am still misreading the question? This is the method I used when I wrote my own implementation of newtons method, I let the user pass a function_handle for f(x) and a second function_handle for df/dx.
Elbarto