class folder problem

Hi,
I'm working on a project in which I defined 4 classes using "classdef" block with class constructor within the class definition file (4 seperate files). For each class definition file, I created a folder with the "@" sign before the folder's name and make sure the folder name (except the "@") is the same as the class definition .m file name. I also made sure that the parent folder including these 4 folders with "@" sign is on the Matlab path. I defined class methods in many seperate .m files and the .m function file within a certain class folder may or may not use other class's properties. Outside the 4 class folders (but still under the same Matlab path), I created a script file to run one function which is stored in one of the 4 class folders which calls many other fucntions from all the 4 class folders. Then I got this error message: ??? Undefined function or method '***' for input arguments of type '###'. The '***' is the function called in the script file.
I do not know how to fix the problem. Please help me out! Thank you very much!
Bruce

Answers (1)

Daniel Shub
Daniel Shub on 8 Dec 2011

0 votes

Is ### the class of the folder in which the method is located? If not you need to define the method as a static method in the classdef file. Something like
methods (Static) varargout = mystaticmethod(varargin) end
then you can define the mystaticmethod in a separate m file.

Asked:

Fan
on 7 Dec 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!