taking control of tab completion w/ classdef

조회 수: 1(최근 30일)
Ben Mitch
Ben Mitch 2011년 12월 4일
i am writing my custom classes using the classdef syntax, and sub-classing handle. the classes will be supplied to users, and i would like the tab completion to be as intuitive as possible for them since it's a great way for the class to self-document.
so, ideally, i would like to find a way to take complete control of what appears in the tab-completion list when an instance of my class is dot-indexed. as it stands, i have the following in place:
  • i implement "fieldnames()", which allows me to specify the data fields.
  • i use the attribute (Hidden) on all methods i do not want to appear in the list. this includes all superclass methods, but unfortunately isvalid() is Sealed, and i can't override it.
  • the list comprises the union of the data fields and the non-Hidden methods, as outlined above.
so, i can get the tab-completion list i want, with the exception of isvalid() which appears though i do not want it there. however, to do this i have to override all the superclass methods (e.g. eq, gt, le) with dummy implementations (or calls to the superclass), which seems like the long way round.
the question is - is there an easier way to manage tab completion? or a way to hide that isvalid() method? have i missed an obvious trick?
cheers ben


Community Treasure Hunt

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

Start Hunting!

Translated by