Main Content

dotAssign

Class: matlab.mixin.indexing.RedefinesDot
Namespace: matlab.mixin.indexing

Customize handling of object index assignments that begin with dots

Since R2021b

Syntax

updatedObj = dotAssign(obj,indexOp,varargin)

Description

updatedObj = dotAssign(obj,indexOp,varargin) handles index assignment operations that begin with dots and index into fields that are inaccessible or nonexistent, such as obj.PrivateProp = 3 or obj.NotAProp{1} = 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 dot indexing by inheriting from matlab.mixin.indexing.RedefinesDot.

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

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

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 scalar struct class that implements custom dot indexing, see matlab.mixin.indexing.RedefinesDot.

Version History

Introduced in R2021b