Main Content


Class: matlab.mixin.indexing.RedefinesBrace
Package: matlab.mixin.indexing

Customize handling of object index assignments that begin with braces


updatedObj = braceAssign(obj,indexOp,varargin)


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.



To learn about attributes of methods, see Method Attributes.


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

Introduced in R2021b