parsetoken SciMax Toolbox part2cont

SciMax Toolbox >> part

part

Maxima Function

Calling Sequence

part (expr, n_1, ..., n_k)

Description

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.

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 z+x.

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.

If partswitch is set to true then end is returned when a selected part of an expression doesn't exist, otherwise an error message is given.

Example: part (z+2*y, 2, 1) yields 2.

example (part) displays additional examples.

parsetoken SciMax Toolbox part2cont