Customize indexed reference and assignment behavior for object arrays. Although user-defined classes possess the same indexing behavior as built-in MATLAB® classes, you can modify this behavior when your class has special requirements.
||Number of arguments for customized indexing methods|
||Redefine subscripted reference for objects|
||Redefine subscripted assignment|
||Convert object to array index|
||Create structure argument for subsasgn or subsref|
||Execute built-in function from overloaded method|
MATLAB classes support object array indexing by default.
Object indexed references are in three forms — parentheses, braces, and dot-name:
Object indexed assignments are in three forms — parentheses, braces, and dot-name:
User-defined classes have the same indexing behaviors as that of built-in classes.
By default, the number of values referenced by an indexing operation
determines how many output arguments MATLAB uses to call
When you use
end in an
object indexing expression, such as
end function returns the index value corresponding to the last element in that dimension.
MATLAB can use objects as indices in indexed expressions.