Calling local functions from command line

前端 未结 1 1349
旧巷少年郎
旧巷少年郎 2021-01-12 06:32

I have a local function defined in an m-file. For example:

% begining of public_function.m file
function fh = public_function( )
%
% do some computation...

         


        
1条回答
  •  心在旅途
    2021-01-12 06:55

    The official documentation says that:

    ... you cannot call a local function from the command line or from functions in other files.

    According to this, you must pass its handle to the caller in order to allow invoking it indirectly outside its m-file. I believe that there is no documented sensible way to access local functions otherwise.

    Oddly though, you can still do this with help:

    help public_function>local_function
    

    0 讨论(0)
提交回复
热议问题