matlab.mixin.Scalar Class
Namespace: matlab.mixin
Superclasses: matlab.mixin.indexing.RedefinesParen
Description
Instances of classes that inherit from matlab.mixin.Scalar
always behave as scalars:
The array size is always 1-by-1.
The creation of empty arrays is prohibited.
Concatenation of instances is prohibited.
Scalar
inherits from matlab.mixin.indexing.RedefinesParen
. The protected methods that enable parentheses
indexing—parenReference
, parenAssign
,
parenDelete
, and parenListLength
—error by default in
Scalar
. You can overload these methods to customize parentheses behavior for
your class.
An example of a use case for this mixin is a class that acts as an interface to a piece of hardware, such as a robotic device. Forming an array of instances of such a class might not make sense because each device can be in a different state or supporting different operations. Concatenating several instances of device states also does not have an obvious use or interpretation.
Class Attributes
HandleCompatible | true |
Abstract | true |
For information on class attributes, see Class Attributes.