I would like to define a class in one file, and its methods in several other files.
Apparently, the way to do this is to create a subfolder named @<ClassName>in the class folder, and to put all the method files in the so-called “@-folder”.
However, once I’ve made the @-folder, I’m not sure what to put in the class-definition file to make it aware of the methods in the @-folder.
classdef myClass
properties
myProperty = 0;
end
methods
%#
%# --- What goes here? ---
%#
end
end
You declare the function signature without the
functionkeyword, and with a semicolon at the end.Then MATLAB will go looking for a file called
../@MyClass/my_function.m.