This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Partition (modified)PadRight

PadLeft

FilledSmallSquarePadLeft[list, n] makes a list of length n by padding list with zeros on the left.

FilledSmallSquarePadLeft[list, n, x] pads by repeating the element x.

FilledSmallSquarePadLeft[list, n, , , ... ] pads by cyclically repeating the elements .

FilledSmallSquarePadLeft[list, n, padding, m] leaves a margin of m elements of padding on the right.

FilledSmallSquarePadLeft[list, , , ... ] makes a nested list with length at level i.

FilledSmallSquare Example: PadLeft[a,b,c, 7] LongRightArrow.

FilledSmallSquarePadLeft[list, n, ... ] always returns a list of length n, except in some special cases where padding is {}.

FilledSmallSquare With padding , , ... , cyclic repetitions of the are effectively laid down and then the list is superimposed on top of them, with the last element of the list lying on an occurrence of .

FilledSmallSquare Examples: PadLeft[a,b, 7, x,y,z] LongRightArrow.

FilledSmallSquarePadLeft[a,b, 7, x,y,z, 2] LongRightArrow.

FilledSmallSquarePadLeft[list, n, padding, -m] truncates the last m elements of list.

FilledSmallSquare A margin of Round[(n-Length[list])/2] effectively centers list.

FilledSmallSquarePadLeft[list, n, list] effectively treats list as cyclic.

FilledSmallSquarePadLeft[list, n, xlist] can be used to repeat an individual element that is itself a list.

FilledSmallSquare Example: PadLeft[a,b,c, 5, u] LongRightArrow.

FilledSmallSquarePadLeft[, n, , , ... ] repeats the sequence of as many times as fits in a list of length n.

FilledSmallSquarePadLeft[list, , , ... ] creates a full array with dimensions , , ... even if list is ragged.

FilledSmallSquare Negative specify to pad on the right.

FilledSmallSquarePadLeft[list, , , , , ... , , ... , ... ] pads by repeating the block of .

FilledSmallSquarePadLeft[list, , , ... , list] effectively treats list as cyclic in every dimension.

FilledSmallSquarePadLeft[list, , , ... , padding, , , ... ] uses margin at level i.

FilledSmallSquare The object list need not have head List.

FilledSmallSquare See The Mathematica Book: Section 1.8.6.

FilledSmallSquare See also: PadRight, Join, Partition, ListCorrelate, RotateLeft.

Further Examples

Partition (modified)PadRight