Maple Tutorial 4:
Sequences, Lists, and Sets
M.M. Yovanovich
TUTORIAL4.MWS
Sequences, lists and sets.
> restart:
> list1:= [1,2,3,4];
> list2:= [1+x^2, 1-x^2];
> set1:= {1,2,3,4};
> set2:= {1+x^2, 1-x^2};
> list1[1]; list2[2];
> op(1, list2); op(2, list2);
> expand(op(1, list2)*op(2, list2));
> map(exp, list2);
> map(cos, list2); subs(x = Pi, %); evalf(%, 6);
> xs:= [seq(x.j, j = 1..5)];
> nops(xs); s2:= add(xs[j], j = 1..nops(xs));
> average:= s2/nops(xs);