Documentation for protected/private methods

조회 수: 1 (최근 30일)
Peter Borda
Peter Borda 2020년 10월 6일
편집: Peter Borda 2020년 10월 6일
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개)

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by