subsref
Indexed reference using function call
Syntax
Description
returns the result from a parentheses, brace, or dot indexing expression, or a
combination of one or more of those types, performed on the array
B
= subsref(A
,S
)A
. The structure S
contains the
details of the indexing expression to be performed.
Note
Performing indexing by calling the subsref
function
explicitly is always slower than the equivalent indexing statement.
Examples
Input 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