Documentation for protected/private methods
2 次查看(过去 30 天)
显示 更早的评论
Hello!
I find the Matlab built-in solution for automatically generating classdef documentation page to be quite a handy solution:
doc MyClassdef
Following some basic commenting rules it makes rapid documentation lot easier.
However, I bumped into an issue, for which I couldn't find a work-around yet... I define some static methods using some external m-files. The external file contains all the explanations and help for the user, so that the main classdef can be kept relatively clean. These 'documentation-snippets' however cannot be accessed over the rapid Matlab documentation tool if they are set to private or protected, thus all the help is hidden...
classdef MyClassdef
methods
function SomeUserTriggeredFunction(varargin)
a = obj.ExternalStaticMethod(varargin);
end
end
methods (Static, Access = ?Protected)
a = ExternalStaticMethod(varargin)
end
end
A fast-foreward solution would be to get rid of the external m-file and copy every single comment line directly in the 'SomeUserTriggeredFunction' methodm, but I would end up with a classdef containing tons of comments.
What would be your proposed solution for the situation? Do you have any idea for keeping the main classdef clean, but also giving the user the possibility to access the helps?
Many thanks in advance! BOPe
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!