Comments above the definition have precedence over a comment next to the definition.
For example, modify the property definitions in the class definition file myClass.m.
properties
a % First property of myClass
% b - Second property of myClass
% The description for b has several
% lines of text.
b % Other comment
end
View the help for properties in the Command Window using the help command. Specify
both the class name and property name, separated by a dot.
help myClass.a
a - First property of myClass
help myClass.b
b - Second property of myClass
The description for b has several
lines of text.
Enumerations
Like properties, there are two ways to create help for enumerations:
- Insert comment lines above the enumeration definition. Use this approach for
multiline help text. - Add a single-line comment next to the enumeration definition.
Comments above the definition have precedence over a comment next to the definition.
For example, create an enumeration class in a file named myEnumeration.m.
classdef myEnumeration
enumeration
uno, % First enumeration
% DOS - Second enumeration
% The description for DOS has several
% lines of text.
30 Custom Help and Documentation