MATLAB帮助抽象方法的内容

Art*_*ard 2 documentation matlab

在普通的类方法中,我可以在MATLAB中为"help"命令提供内容.但是,在编写抽象方法时,帮助函数不会看到抽象方法.例如,如果您有一个NeedsHelp类:

classdef NeedsHelp
    methods (Abstract)
        INeedHelp(self)
        % This method is not visible to the help command.
    end
    methods
        function IHaveHelp(self)
            % This method shows help as expected.
        end
    end
end
Run Code Online (Sandbox Code Playgroud)

help命令的行为如下(R2009b):

>> help NeedsHelp.IHaveHelp
  This method shows help as expected.

>> help NeedsHelp.INeedHelp

NeedsHelp.INeedHelp not found.
Run Code Online (Sandbox Code Playgroud)

有没有为抽象方法提供文档的解决方案?

Sam*_*rts 6

将帮助放在抽象方法的函数行之前,就像对属性一样.我没有9b进行测试,但是在11b:

classdef NeedsHelp
    methods (Abstract)
        % Help goes here.
        INeedHelp(self)
    end
end

>> help NeedsHelp.INeedHelp
  Help goes here.
Run Code Online (Sandbox Code Playgroud)