numArgumentsFromSubscript
Number of arguments from indexing methods
Description
returns the number of expected inputs to n = numArgumentsFromSubscript(A,S,indexingContext)subsasgn or the number of expected outputs from subsref. The target of the indexing expression is A, and
the structure S contains the details of the indexing expression.
indexingContext is an enumerated value that identifies whether the
indexing expression occurs in a statement, expression, or assignment.
Examples
Input Arguments
Tips
You can overload
subsref,subsasgn, andnumArgumentsFromSubscriptto 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.
Version History
Introduced in R2015b