저는 몇 가지 광범위한 문서 작업을 수행 한 수퍼 클래스를 보유하고 있습니다. 이 수퍼 클래스에서 상속받은 하위 클래스가 있으며 가능한 경우 수퍼 문서를 다시 사용하고 싶습니다.Matlab의 수퍼 클래스에서 문서를 상속하는 방법은 무엇입니까?
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가 : 슈퍼 클래스 ClassA
와 예를 들어
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
의 도움말 설명을 얻을. 나는 슈퍼의 도움말 설명도 포함 시키길 원합니다. 출력은 다음과 같습니다.
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
이 방법이 있습니까?
나는 이것을 할 수 있다고 생각지 않는다. 그러나 수퍼 클래스에 자동으로 연결되는 "보기"도 포함시킬 수 있습니다. 'ClassB' 문서의 끝 부분에'See also CLASSA'를 넣으면 나머지는 MATLAB이 처리합니다. – wakjah
나는 이것에 대해 몰랐다. 그건 아주 영리합니다. – KronoS