matlab.mixin.indexing.RedefinesDot.dotAssign - Customize handling of object index assignments that begin with dots - MATLAB (original) (raw)

Main Content

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](#mw%5F64eedb5b-c841-41ca-9488-e6b4bb6aac9f) = dotAssign([obj](#mw%5F974a5d8c-ef6f-481c-a917-ffb51bb2b3c3),[indexOp](#mw%5F6fcbff46-9fc6-4311-8931-c7ff21de48e5),[varargin](#mw%5Fd91d1c06-568a-4c0d-b879-5bfe42d48cd7)) handles index assignment operations that begin with dots and index into fields that are inaccessible or nonexistent, such as obj.PrivateProp = 3 orobj.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 ofIndexingOperation 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 ofvarargin is {B}.

Output Arguments

expand all

Updated object after assignment operation.

Attributes

Access protected
Abstract true

To learn about attributes of methods, seeMethod 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