|
From: | Ben Abbott |
Subject: | Re: function handles & dispatch |
Date: | Tue, 23 Jun 2009 07:24:50 -0400 |
On Jun 23, 2009, at 5:58 AM, Jaroslav Hajek wrote:
hi, scanning the Matlab online docs, I found this paragraph in the section on function handles: For nonoverloaded functions, subfunctions, and private functions, a function handle references just the one function specified in the @functionname syntax. When you evaluate an overloaded function by means of its handle, the arguments the handle is evaluated with determine the actual function that MATLAB dispatches to. I don't think Octave currently does this - only functions are looked for, and the function is fixed once the handle is evaluated. Can anyone verify this is true in Matlab? Should we change the behavior to be Matlab compatible? regards
I haven't implemented any overloading myself, but have used Matlab toolboxes that do.
One nice example is CVX: Matlab Software for Disciplined Convex Programming.
http://www.stanford.edu/~boyd/cvx/ Also, overloaded functions are included in Matlab's core functions. .../Matlab_R2009a.app/toobox/matlab/datafun/@cell .../Matlab_R2009a.app/toobox/matlab/datafun/@uint8 .../Matlab_R2009a.app/toobox/matlab/datafun/@uint16These directories contain conv2.m, convnc.m, fft.m, fftn.m ifft.m, & ifftn.m. The versions for double reside directly in the datafun directory.
As the CVS license uses GNU General Public License 2.0, it would be nice to be able to run it from Octave.
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |