我有一个 Super 类,我已经完成了一些广泛的文档。有从这个超类继承的子类,如果可能的话,我想重用超类的文档。例如超级类ClassA
:
classdef ClassA
%CLASSA Super Class for all others classes
%
% CLASSA Properties:
% Prop1 It's the first property
% Prop2 It's the second
%
% CLASSA Methods:
% Method1 It's a method
% Method2 It's another method
function value = Method1(var)
% Super implementation of Method1
end
% Other method definitions follow
end
还有一个子类 ClassB:
classdef ClassB < ClassA
%CLASSB Subclass of super class CLASSA
%
% CLASSB Properties:
% Prop3 It's the first property of subclass
%
% CLASSB Methods:
% Method 3 It's the first method of subclass
function value = Method1(var)
% Subclass implementation of Method1
end
% Other method definitions follow
end
如果我输入help ClassB
,我只会得到ClassB
帮助描述。我希望也包含 Super 的帮助说明。输出看起来像这样:
CLASSB Subclass of super class CLASSA
CLASSB Properties:
Prop1 It's the first property
Prop2 It's the second
Prop3 It's the first property of subclass
CLASSB Methods:
Method1 It's a method
Method2 It's another method
Method3 It's the first method of subclass
有没有办法做到这一点?