How to make functions outside of Class folder hidden from access
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!