Mam super klasę, na której zrobiłem obszerną dokumentację. Istnieją podklasy, które dziedziczą z tej super klasy i chciałbym ponownie użyć dokumentacji super, jeśli to możliwe. Na przykład z super klasy ClassA
:Jak dziedziczę dokumentację od superklatek w 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
a podklasy 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
Jeśli wpisuję help ClassB
mam tylko ClassB
„s opis pomocy. Chcę również dołączyć opis pomocy Super. Dane wyjściowe wyglądają mniej więcej tak:
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
Czy istnieje sposób, aby to zrobić?
Nie sądzę, że można to zrobić; Można jednak dołączyć "zobacz również", który automatycznie łączy się z twoją superklasą; po prostu umieść 'Zobacz także CLASSA. 'na końcu twojej dokumentacji' ClassB', a MATLAB zrobi resztę. – wakjah
Nie wiedziałem o tym. To bardzo sprytne. – KronoS