subsasgn
Subscripted assignment using function call
Syntax
Description
returns the result from a parentheses, brace, or dot indexing assignment, or a combination
of one or more of those types, performed on the array R
= subsasgn(A
,S
,B
)A
. The structure
S
contains the details of the assignment to be performed, and
B
is the value to be assigned into A
.
Note
Performing an indexing assignment by calling the subsasgn
function explicitly is always slower than the equivalent indexing statement.
Examples
Input Arguments
Output Arguments
Tips
You can overload
subsref
andsubsasgn
to customize indexing for your classes. However, for most classes authored in R2021b and later, the recommended process for customizing indexing is to inherit from some combination ofmatlab.mixin.indexing.RedefinesParen
,matlab.mixin.indexing.RedefinesDot
, andmatlab.mixin.indexing.RedefinesBrace
. For more information, see Customize Object Indexing.
Extended Capabilities
Version History
Introduced before R2006a