Inheriting help documentation from an Abstract base class method
古いコメントを表示
Suppose I have a base class with many subclasses, each of which will override an abstract method in the base class,
classdef BaseClass
methods (Abstract)
out=somefunction(in);
end
end
classdef SubClass1<BaseClass
...
end
classdef SubClass2<BaseClass
...
end
...
classdef SubClassN<BaseClass
...
end
The subclasses must all provide non-Abstract implementations of somefunction(). They will all be different implementations, but their input/output syntaxes may all be the same, in which case their help text would all be the same. Is there a way to add a help documentation line in BaseClass.somefunction() that will be 'inherited' by all the sub-classes, so that
>> help SubClass1.somefunction
>> help SubClass2.somefunction
...
>> help SubClassN.somefunction
will all print the same documentation? Naturally, this would be a lot more economical than copying the same help text to all the individual SubClass classdef files.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Class Introspection and Metadata についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!