Main Content


Class: matlab.mixin.indexing.RedefinesParen
Namespace: matlab.mixin.indexing

Customize handling of object index assignments that begin with parentheses

Since R2021b


updatedObj = parenAssign(obj,indexOp,varargin)


updatedObj = parenAssign(obj,indexOp,varargin) handles index assignment operations that begin with parentheses, such as obj(idx) = B or obj(idx).prop{1} = B. 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 parentheses indexing by inheriting from matlab.mixin.indexing.RedefinesParen.

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

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 for this argument.

Output Arguments

expand all

Updated object after assignment operation.



To learn about attributes of methods, see Method Attributes.


For a fully annotated example of a mapping class that implements custom parentheses indexing, see Customize Parentheses Indexing for Mapping Class.

Extended Capabilities

Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

Version History

Introduced in R2021b