Main Content

braceAssign

Class: matlab.mixin.indexing.RedefinesBrace
Namespace: matlab.mixin.indexing

Customize handling of object index assignments that begin with braces

Since R2021b

Syntax

updatedObj = braceAssign(obj,indexOp,varargin)

Description

updatedObj = braceAssign(obj,indexOp,varargin) handles index assignment operations that begin with braces, such as obj{4} = 3 or obj{1}.prop{2} = 4. The indexOp object contains the indices of the values being changed, and varargin is a cell array of values to be assigned to those indexed locations. The method returns the updated object.

Input Arguments

expand all

Object that implements customized brace indexing by inheriting from matlab.mixin.indexing.RedefinesBrace.

Types of indexing operation and indices referenced, specified as an array of IndexingOperation objects. For a brace assignment, the first object in the array has a Type property of Brace.

Values to be assigned in the indexing operation, specified as a cell array. For example, in the assignment operation obj{1} = B, the value B is the only element in this argument.

Output Arguments

expand all

Updated object after assignment operation.

Attributes

Accessprotected
Abstracttrue

To learn about attributes of methods, see Method Attributes.

Examples

For an example of a class that implements custom brace indexing, see matlab.mixin.indexing.RedefinesBrace.

Version History

Introduced in R2021b