MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

myClass Summary of myClass
This is the first line of the description of myClass.
Descriptions can include multiple lines of text.


myClass Properties:
a - Description of a
b - Description of b


myClass Methods:
doThis - Description of doThis
doThat - Description of doThat


Methods


Create help for a method by inserting comments immediately after the function definition
statement. For example, modify the class definition file myClass.m to include help for the
doThis method.


function doThis(obj)
% doThis Do this thing
% Here is some help text for the doThis method.
%
% See also DOTHAT.


disp(obj)
end


View the help text for the method in the Command Window using the help command.
Specify both the class name and method name, separated by a dot.


help myClass.doThis


doThis Do this thing
Here is some help text for the doThis method.


See also doThat.


Properties


There are two ways to create help for properties:



  • Insert comment lines above the property definition. Use this approach for multiline
    help text.

  • Add a single-line comment next to the property definition.


Create Help for Classes
Free download pdf