Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I pass a value to a function called by ode45?
Date: Fri, 8 Feb 2013 03:42:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <kf1s6f$8va$1@newscl01ah.mathworks.com>
References: <kerh1u$72o$1@newscl01ah.mathworks.com> <kerhrj$aeq$1@newscl01ah.mathworks.com> <kes0dn$arn$1@newscl01ah.mathworks.com> <kf0jia$58o$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1360294927 9194 172.30.248.37 (8 Feb 2013 03:42:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 8 Feb 2013 03:42:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2105620
Xref: news.mathworks.com comp.soft-sys.matlab:788581

"Steven_Lord" <slord@mathworks.com> wrote in message 
> 
> ODE45 requires the function that you pass into it as a function handle for 
> the first input to accept two input arguments.
> 
> Your function f requires three input arguments.
> 
> If we have a function that accepted the two input arguments from ODE45 and 
> passed them and another value into f, to serve as an adapter or go-between 
> for ODE45 and the f function, they will both be satisfied. The anonymous 
> function IS that adapter/go-between. The "@(t, y)" section of the anonymous 
> function indicates that it accepts two inputs (and so is a valid first input 
> for ODE45) and the "f(t, y, beta)" section calls f with three input 
> arguments (as it requires.)
> 
> -- 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on 
> http://www.mathworks.com 

Ahhh. In other words, the anonymous function "@(t,y)" is a function with one line. That line is "f(t,y,beta)".
Pretty neat.
Thanks for explanation.