Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: objects containing functions
Date: Mon, 29 Mar 2010 17:53:05 +0000 (UTC)
Organization: CSHL
Lines: 11
Message-ID: <hoqpe1$nve$1@fred.mathworks.com>
References: <hoqo8l$4vl$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1269885185 24558 172.30.248.38 (29 Mar 2010 17:53:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Mar 2010 17:53:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1739148
Xref: news.mathworks.com comp.soft-sys.matlab:621599


> Any suggestions how I could do this better - i.e. ways of defining f within the object, but so it is as fast to evaluate as if it were a separate function?
> 
> Thanks, S

I don't know exactly what you mean by an "in-line function" in this case. You mean you created a function handle or that you've defined a sub-function within another function?

The last few releases of Matlab have made it very easy to create object properties. 
www.mathworks.com/products/matlab/object_oriented_programming.html
www.mathworks.com/company/newsletters/digest/2008/sept/matlab-objects.html
I've used this for problems in the psat  but haven't bench-marked it. In earlier versions you had to put your functions into a funny "@myObject" directory. Never used those.