# # 4.1 Sequences # # # # MAPLE SESSION 1 # > x := 1,2,3; > y := 4,5,6; > x,y; # # # MAPLE SESSION 2 # > f:='f': seq(f(i), i=1..6); > seq(i^2, i=1..5); > x:= 'x': > x$4; # # # MAPLE SESSION 3 # > b:='b': c:='c': > L := a+b+2*c+3*d; > op(%); # # # MAPLE SESSION 4 # > nops(L); > op(3,L); # # # MAPLE SESSION 5 # > s := 1, 8, 27, 64, 125; > s[3]; # # 4.2 Sets # # # # MAPLE SESSION 6 # > y := 'y': {x,y,z,y}; # # # MAPLE SESSION 7 # > a := {1,2,3,4}; b := {2,4,6,8}; > a union b; > a intersect b; > a minus b; # # # MAPLE SESSION 8 # > member(2,a); > member(5,a); > a[3]; # # 4.3 Lists # # # # MAPLE SESSION 9 # > a:='a': b:='b': > L1 := [x,y,z,y]; L2 := [a,b,c]; > L := [op(L1),op(L2)]; > L[5]; # # # MAPLE SESSION 10 # > s := seq( i/(i+1), i=1..6); > M := [s]; > M[2..5]; # # 4.4 Tables # # # # MAPLE SESSION 11 # > T := table([a,b]); > T[2]; # # # MAPLE SESSION 12 # > S := table([(1)=A,(3)=B+C,(5)=A*B*C]); > S[3]; > S; > op(S); # # 4.5 Arrays # # # # MAPLE SESSION 13 # > A := array(1..2,1..3); > op(A); > B := array(1..2,1..2,1..2); > op(B); # # # MAPLE SESSION 14 # > C:=array(1..2,1..2): > C[1,1]:=1: C[1,2]:=2: C[2,1]:=3: > C[2,2]:=7: > op(C); > print(C); # # # MAPLE SESSION 15 # > F:=array(1..2,1..3,[[1,2,3],[5,9,7]]); # # 4.6 Data conversions # # # # MAPLE SESSION 16 # > A := {1,2,3}: > s := 1,2,3: > L := [1,2,3]: > T := table([1,2,3]): > M := array(1..3,[1,2,3]): > type(L,list); > type(T,set); # # # MAPLE SESSION 17 # > convert(A,list); > convert(L,set); # # # MAPLE SESSION 18 # > whattype(A); > whattype(s); > whattype(L); > whattype(T); > whattype(op(T)); > whattype(M); > whattype(op(M));