Borrar filtros
Borrar filtros

How to make functions outside of Class folder hidden from access

5 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Steven Lord
Steven Lord el 8 de Mzo. de 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 comentario
Kevin Phung
Kevin Phung el 9 de Mzo. de 2019
Thanks for the response steven, I wasnt too sure how to formulate my search but you definitely lead me in the right direction!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Identification en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by