substruct
Create indexing structure argument
Description
creates a structure with the information required by the S
= substruct(type
,subs
)subsref
and subsasgn
functions. The
type
argument indicates whether the indexing expression is
parentheses, dot, or brace. The corresponding subs
argument is a field
name for dot indexing or a cell array containing index vectors for parentheses or brace
indexing.
Note
Performing indexing by calling the subsref
or
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