Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

UpTo

UpTo[n]
is a symbolic specification that represents up to n objects or positions. If n objects or positions are available, all are used. If fewer are available, only those available are used.

ExamplesExamplesopen allclose all

Basic Examples  (6)Basic Examples  (6)

Take up to the number of elements available:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Drop up to the number of elements available:

In[1]:=
Click for copyable input
Out[1]=

Take up to the number of elements available, dropping what remains, if anything:

In[1]:=
Click for copyable input
Out[1]=

Partition into blocks that are up to 3 elements long; the last block is shorter:

In[1]:=
Click for copyable input
Out[1]=

Give the 10 most common elements, or as many as are available:

In[1]:=
Click for copyable input
Out[1]=

Give the order of the 10 smallest elements, or as many as are available:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2015
(10.3)