Classdef: Difference between revisions

Jump to navigation Jump to search
408 bytes added ,  19 June 2015
local functiosn in classdef files
m (use direct url instead of archived docs)
(local functiosn in classdef files)
Line 42: Line 42:
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.
As a workaround, we can create an indirection using an anonymous function <code>fh = @(varargin) mypackage.myfunc(varargin{:})</code>.
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported.
Similarly for static class methods where <code>fh = @MyClass.myfunc</code> isn't yet supported.
* Defining [http://www.mathworks.com/help/matlab/matlab_oop/specifying-methods-and-functions.html#br2la89 local functions] in the same classdef-file is not working. For example, the following code gives a syntax/parse error:
<source lang="octave">
classdef MyClass
    methods
        function obj = MyClass()
            myfunc()
        end
    end
end
function myfunc()
    disp('myfunc')
end
</source>


==== supported ====
==== supported ====
14

edits

Navigation menu