I have a function like the following:
function FHandle = myFunction
FHandle = @mySubFunction;
function mySubFunction
Now I can get the function Handle of the Subfunction by simply calling the myFunction and call the mySubFunction from outside the function.
The Properties are stored within the FunctionHandle itself which you can get by functions(FHandle)
So far so well
No I want to create such a FunctionHandle for a Subfunction from outside the function. Wit ohter word I want to edit the properties i can see with the functions-command.
Does anybody know a way to do that?
Regards
Lord nibbler
Those aren't really properties in the object-oriented, "I can set and get
them", sense. They're simply information about the function handle.
> So far so well
>
> No I want to create such a FunctionHandle for a Subfunction from outside
> the function. Wit ohter word I want to edit the properties i can see with
> the functions-command.
> Does anybody know a way to do that?
You can't do either of these. The subfunction is only in scope inside the
file in which it is defined, since it's not the main function in that file.
Therefore attempting to create a function handle to a function of that name
will either not work (if no function of that name is in scope when the
function handle is created) or will refer to a function that's in scope.
[That description is a _little_ bit of a simplification, but it's close
enough for purposes of this post.] You cannot modify the information
displayed by the FUNCTIONS command either (well, if you called FUNCTIONS
with an output argument you could, but that wouldn't change the function
handle.)
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
Best regards
Daniel G