Main Content

matlab.indexing.IndexingOperation class

Package: matlab.indexing

Type of customized indexing operation and referenced indices

Since R2021b

Description

For classes that implement customized indexing operations, MATLAB® constructs instances of matlab.indexing.IndexingOperation to describe the type of a given indexing operation and the indices referenced by that operation. IndexingOperation instances appear as arguments for methods of these classes:

Class Attributes

Sealed
true

For information on class attributes, see Class Attributes.

Creation

MATLAB creates instances of IndexingOperation as needed. The property values are set at creation.

Properties

expand all

Type of indexing operation, identified as an IndexingOperationType enumeration member:

  • Brace

  • Dot

  • Paren

  • ParenDelete

Attributes:

GetAccess
public
SetAccess
immutable

List of indices referenced in indexing operation, specified as a cell array. When the Type property is Dot, accessing this property results in an error.

Attributes:

GetAccess
public
SetAccess
immutable

Name of the field referenced in a dot indexing operation, specified as a string. When the Type property has any value except for Dot, accessing this property results in an error.

Attributes:

GetAccess
public
SetAccess
immutable

Examples

Sample Property Values

This table shows examples of customized indexing calls and the type of IndexingOperation instances that MATLAB creates. Expressions with more than one indexing operation generate arrays of IndexingOperation instances.

Indexing Expression

IndexingOperation Instances

obj(1,[2,3]) = 4

Type: IndexingOperationType.Paren

Indices: {1,[2,3]}

obj.PrivateProp{1}

Instance 1:

Type: IndexingOperationType.Dot

Name: "PrivateProp"

Instance 2:

Type: IndexingOperationType.Brace

Indices: {1}

obj(true,:) = []

Type: IndexingOperationType.ParenDelete

Indices: {1,':'}

Version History

Introduced in R2021b