Effacer les filtres
Effacer les filtres

How to make functions outside of Class folder hidden from access

5 vues (au cours des 30 derniers jours)
Kevin Phung
Kevin Phung le 8 Mar 2019
Commenté : Kevin Phung le 9 Mar 2019
Hi all, I have a class folder, we'll call class1.
class1 contains properties and methods, both hidden and not.
To access these methods or properties, I use the dot notation :
class1.func1
class.Property1
I like using the 'Tab' button to cycle/auto-type through my properties and methods. However, some functions that are inherit / default to matlab are showing up
for reasons I'm not sure why. Example:
class1.AddListener
class1.delete
class1.findobj
class1.isvalid
% etc...
Most of their paths come from: C:\Program Files\MATLAB\R2018a\toolbox\matlab\lang\
they're a bit distracting, because I want the user to type:
'class1.' , hit tab, and see what they have available to access.

Réponse acceptée

Steven Lord
Steven Lord le 8 Mar 2019
Your class is a handle class. As stated in the "Handle Class Methods" section of this documentation page that means you inherit a dozen methods.
For all those methods except isvalid you could "extend" it as shown on this documentation page in a methods block with the Hidden attribute and I believe that would allow them to still work while removing them from tab completion. The isvalid method is different, it is Sealed so you can't override it with a Hidden method in your subclass.
Another possibility, if your class doesn't need to be a handle class, would be to remove that superclass from your class's definition.
  1 commentaire
Kevin Phung
Kevin Phung le 9 Mar 2019
Thanks for the response steven, I wasnt too sure how to formulate my search but you definitely lead me in the right direction!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Identification dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by