Main Content

parenDotAssign

Class: matlab.mixin.indexing.RedefinesDot
Package: matlab.mixin.indexing

Object assignments with combined parentheses and dot indexing

Syntax

updatedObj = parenDotAssign(obj,indexOp,varargin)

Description

updatedObj = parenDotAssign(obj,indexOp,varargin) handles assignment operations that begin with built-in parentheses indexing immediately followed by customized dot indexing. Examples include:

  • obj(idx).prop = val

  • obj(idx).(field) = val

  • [obj(idx).prop] = val

  • [obj(idx).(field)] = val

This method handles assignments that are combinations of parentheses and dot indexing for classes that inherit from matlab.mixin.indexing.RedefinesDot but do not inherit from matlab.mixin.indexing.RedefinesParen. The indexOp object contains the indexing operations and the indices of the values being changed. 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 dot indexing by inheriting from matlab.mixin.indexing.RedefinesDot.

Types of indexing operations and indices referenced, specified as an array of IndexingOperation objects.

Values to be assigned in the indexing operation, specified as a cell array. For example, in the assignment operation obj(idx).prop = B, the value of varargin is {B}.

Output Arguments

expand all

Updated object after assignment operation.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022b