Thread: Ode45
View Single Post
  #4  
Old October 28th, 2009, 04:38 PM
elbarto elbarto is offline
Member
 
Join Date: Mar 2007
Posts: 143
Country:
Thanks: 20
Thanked 21 Times in 20 Posts
elbarto is on a distinguished road
Default

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
Reply With Quote
The following users thank elbarto for this useful post:
Donate to MHF