MATLAB Object-Oriented Programming
Represent State with Enumerations The MachineState class defines two enumeration members to represent the state of a machine, ei ...
NotRunning See Also Related Examples “Enumerations That Encapsulate Data” on page 14-41 14 Enumerations ...
Enumerations That Encapsulate Data In this section... “Enumeration Classes with Properties” on page 14-41 “Store Data in Propert ...
end end enumeration Blueish (18/255,104/255,179/255) Reddish (237/255,36/255,38/255) Greenish (155/255,190/255,61/255) Purplish ...
The Colors class encapsulates the definitions of a standard set of colors. You can change the enumeration class definition of th ...
end end The CarPainter class requires its subclasses to define a method called paint: classdef CarPainter < handle methods (A ...
Save and Load Enumerations In this section... “Basic Knowledge” on page 14-45 “Built-In and Value-Based Enumeration Classes” on ...
Causes: Load as struct Instead of Object If you add a new named value or a new property to a class after saving an enumeration, ...
See Also More About “Named Values” on page 14-2 See Also ...
...
Constant Properties 15 ...
Define Class Properties with Constant Values In this section... “Defining Named Constants” on page 15-2 “Constant Property Assig ...
ClassName.PropName For example, to use the NamedConst class defined in the previous section, reference the constant for the degr ...
(1/AstroConstants.Re - 0.5 * r); end Constant Property Assigned a Handle Object If a class defines a constant property with a va ...
properties Date Department ProjectNumber end methods (Access = private) function obj = MyProject obj.Date = datestr(clock); obj. ...
ans = Quality Assurance Clearing the class results in the assignment of a new instance of MyProject to the ProjectInfo property. ...
Information from Class Metadata “Class Metadata” on page 16-2 “Class Introspection with Metadata” on page 16-5 “Find Objects wi ...
Class Metadata In this section... “What Is Class Metadata?” on page 16-2 “The meta Package” on page 16-3 “Metaclass Objects” on ...
The meta Package The meta package contains metaclasses that describe the definition of classes and class components. The class n ...
The metaclass function returns the meta.class object (that is, an object of the meta.class class). You can obtain other metaclas ...
«
30
31
32
33
34
35
36
37
38
39
»
Free download pdf