Main Content

parenDotListLength

Class: matlab.mixin.indexing.RedefinesDot
Namespace: matlab.mixin.indexing

Number of values to return from customized indexing assignments with parentheses and dots

Since R2022b

Syntax

n = parenDotListLength(obj,indexOp,indexContext)

Description

n = parenDotListLength(obj,indexOp,indexContext) determines the number of values n to return from customized indexing assignment operations that begin with built-in parentheses indexing and are immediately followed by customized dot indexing. For example, MATLAB® calls parenDotListLength for an assignment statement like [obj(idx).label{:}] = A. This method is called for classes that inherit from matlab.mixin.indexing.RedefinesDot but do not inherit from matlab.mixin.indexing.RedefinesParen. The indexOp object contains the indices being changed. indexContext is matlab.indexing.IndexingContext.Assignment for the default implementation of the method.

Input Arguments

expand all

Object that implements customized dot indexing by inheriting from matlab.mixin.indexing.RedefinesDot.

Types of indexing operations and indices referenced, specified as an array of IndexingOperation objects.

Context in which the indexing operation occurs, specified as one of these enumeration members:

  • matlab.indexing.IndexingContext.Statement — Indexed reference used as a statement (for example, obj.a)

  • matlab.indexing.IndexingContext.Expression — Indexed reference used as an argument to a function (for example, func(obj.a))

  • matlab.indexing.IndexingContext.Assignment — Indexed assignment (for example, [obj.a] = deal(x)).

For the default implementation of the method, MATLAB always passes in matlab.indexing.IndexingContext.Assignment.

Output Arguments

expand all

Number of values to return from an indexing operation, specified as a nonnegative integer.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022b