Download Sysquake Remote User Manual

Transcript
78
Sysquake for LATEX
When an assignment is made to the field of an object in a statement
like A.f=B, LME executes A=subsasgn(A,s,B), where s is a structure
with two fields: s.type which is ’.’, and s.subs which is the name of
the field (’f’ in this case).
While the primary purpose of subsasgn is to permit the use of subscripts with objects, a built-in implementation of subsasgn is provided
for arrays when s.type is ’()’, for lists when s.type is a list, and for
structures when s.type is ’.’.
Examples
A = [1,2;3,4];
subsasgn(A, struct(’type’,’()’,’subs’,{1,’:’}), 999)
999 999
3
4
subsasgn(A, struct(’type’,’()’,’subs’,{’:’,1}), [])
2
4
See also
Operator (), operator {}, subsref, beginning, end
subsref
Reference to a part of an array, list, or structure.
Syntax
B = subsref(A, s)
Description
When an object variable is subscripted in an expression like
A(s1,s2,...), LME evaluates subsref(A,s), where subsref is a
method of the class of variable A and s is a structure with two fields:
s.type which is ’()’, and s.subs which is the list of subscripts
{s1,s2,...}. If a subscript is the colon character which stands for all
elements along the corresponding dimensions, it is represented with
the string ’:’ in s.subs.
When an object variable is subscripted in an expression like A{s},
LME evaluates subsref(A,s), where subsref is a method of the class
of variable A and s is a structure with two fields: s.type which is ’{}’,
and s.subs which is the list containing the single subscript {s}.
When the field of an object variable is retrieved in an expression
like A.f, LME executes subsref(A,s), where s is a structure with two