Main Content

parenAssign

Class: matlab.mixin.indexing.RedefinesParen
Package: matlab.mixin.indexing

Customize handling of object index assignments that begin with parentheses

Syntax

updatedObj = parenAssign(obj,indexOp,varargin)

Description

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(idx) = B, the value B is the only element for 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 a fully annotated example of a mapping class that implements custom parentheses indexing, see Customize Parentheses Indexing for Mapping Class.

Introduced in R2021b