How can I use the ISMETHOD function to determine if an inherited method belongs to a derived object for classes created in MATLAB R2007b or before?
2 views (last 30 days)
Show older comments
I am using the MATLAB R2007b classes system, and I would like to use ISMETHOD to check if a particular method belongs to an instance of a derived class. However, if the method is defined is the base class ISMETHOD returns false.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The ability to do use ISMETHOD on methods defined in a base class is not available in the MATLAB classes system for MATLAB R2007b and before.
This functionality has been added in the MATLAB classes system starting with R2008a.
To work around this issue in releases prior to R2008a, search the output of the METHODS function using the '-full' parameter. For example, if 'd' is an instance of the derived class, and 'theMethod' is a method defined in the base class:
method_list = methods(d, '-full');
if any(strcmp(method_list, 'theMethod'))
disp('theMethod is defined for d');
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!