SetMaxLen
Sets the display limits on an object.
Syntax
-
SetMaxLen(X, n)
-
X
is an object -
n
is a non-negative integer
-
Description
SetMaxLen(X, n)
returns X
with its display limit set to n
. If n = 0
, the global limit will be used; otherwise, n
will be the effective limit.
The display limit governs how the object is printed on screen. It sets a limit to the number of members, elements, or entries that are printed. The exact behaviour depends on the type of X
:
-
For a string, the number of characters is limited.
-
For a vector, the number of components is limited.
-
For a matrix, the number of rows and columns are both limited by the same number.
-
For a list or a set, the number of elements are limited.
-
For any other object, the display limit cannot be set.
(For numbers, SetMaxLen
mimics the behaviour of SetNumDigits
. This is only to make the \
operator applicable to numbers.)
The \
operator is mapped to the SetMaxLen
function.
Examples
IdentityMatrix(10)
⎛1 0 0 0 0 0 0 0 0 0⎞ ⎜0 1 0 0 0 0 0 0 0 0⎟ ⎜0 0 1 0 0 0 0 0 0 0⎟ ⎜0 0 0 1 0 0 0 0 0 0⎟ ⎜0 0 0 0 1 0 0 0 0 0⎟ ⎜0 0 0 0 0 1 0 0 0 0⎟ ⎜0 0 0 0 0 0 1 0 0 0⎟ ⎜0 0 0 0 0 0 0 1 0 0⎟ ⎜0 0 0 0 0 0 0 0 1 0⎟ ⎝0 0 0 0 0 0 0 0 0 1⎠
IdentityMatrix(10) \ 5
⎛1 0 0 0 0 ⋯⎞ ⎜0 1 0 0 0 ⋯⎟ ⎜0 0 1 0 0 ⋯⎟ ⎜0 0 0 1 0 ⋯⎟ ⎜0 0 0 0 1 ⋯⎟ ⎝⋮ ⋮ ⋮ ⋮ ⋮ ⋱⎠