How to make functions outside of Class folder hidden from access

1 回表示 (過去 30 日間)
Kevin Phung
Kevin Phung 2019 年 3 月 8 日
コメント済み: Kevin Phung 2019 年 3 月 9 日
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.

採用された回答

Steven Lord
Steven Lord 2019 年 3 月 8 日
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 件のコメント
Kevin Phung
Kevin Phung 2019 年 3 月 9 日
Thanks for the response steven, I wasnt too sure how to formulate my search but you definitely lead me in the right direction!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by