subsasgn
Redefine subscripted assignment.
📝Syntax
B = subsasgn(A, S, B)
📥Input Arguments
Parameter Description
A Object used in indexing operation
S Structure with two fields: 'type' and 'subs'.
B The assigned value, located on the right side of the assignment statement.
📤Output Arguments
Parameter Description
R The outcome of the assignment statement is the object that has been modified, and this modified object is provided as the first argument.
📄Description

B = subsasgn(A, S, B) assigns a value to an element of a cell or matrix.

💡Examples
Parentheses Indexing
R1 = {1, 'GoodBye', [1, 2;3, 4]};
S = substruct('{}', {1, 3});
R2 = subsasgn(R1, S, 'Hello')
🔗See Also
substruct
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub