Why does MATLAB set the Method Attributes of built-in methods to 'Hidden'?
4 ビュー (過去 30 日間)
古いコメントを表示
'empty' is matlab built-in method."At the bottom of the documentation page, it is mentioned: 'empty is a hidden, public, static method of all nonabstract MATLAB® classes.''
There is a question, if user build a classes method,for certain reasons, users may want to set a class method as 'Hidden' to prevent others from seeing it. However, in the case of MATLAB built-in methods, everyone is aware of their existence. So, what's the purpose of MATLAB setting the Attributes of this method as 'Hidden'?"
If you input mc=?SubClass in command line and open mc-->MethodList in workspace,you will find two method, one is 'SubClass' ,another is 'empty'.In fact, the 'empty' method isn't completely hidden, so what's the significance of setting a built-in method to 'Hidden'?"
classdef SubClass < Base
methods
function obj=SubClass(value)
obj=obj@Base(value);
end
end
end
classdef Base
properties(Access=private)
a;
end
methods
function obj=Base(value)
obj.a=value;
end
end
methods (Access=private)
function Fun(obj)
disp(num2str(obj.a));
end
end
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!