Function: part (<expr>, <n_1>, ..., <n_k>) Returns parts of the displayed form of
expr. It obtains the part of
expr as specified by the indices <n_1>, ..., <n_k>. First part <n_1> of
expr is obtained, then part <n_2> of that, etc. The result is part <n_k> of ... part <n_2> of part <n_1> of
expr. If no indices are specified
expr is returned.
part can be used to obtain an element of a list, a row of a matrix, etc.
If the last argument to a
part function is a list of indices then several subexpressions are picked out, each one corresponding to an index of the list. Thus
part (x + y + z, [1, 3]) is
piece holds the last expression selected when using the
part functions. It is set during the execution of the function and thus may be referred to in the function itself as shown below.
partswitch is set to
end is returned when a selected part of an expression doesnt exist, otherwise an error message is given.
(%i1) part(z+2*y+a,2); (%o1) 2 y (%i2) part(z+2*y+a,[1,3]); (%o2) z + a (%i3) part(z+2*y+a,2,1); (%o3) 2
example (part) displays additional examples.
There are also some inexact matches for
?? part to see them.
(%o1) true (%i2)