is an attribute that can be assigned to a symbol to indicate that the function should automatically be threaded over lists that appear as its arguments.
- Listable functions are effectively applied separately to each element in a list, or to corresponding elements in each list if there is more than one list.
- Most built‐in mathematical functions are Listable. »
- All the arguments which are lists in a Listable function must be of the same length. »
- Arguments that are not lists are copied as many times as there are elements in the lists.
Examplesopen allclose all
Basic Examples (3)
Log is listable:
To apply a function to a vector, take advantage of Listable functions when possible:
Step initial condition on spatial grid x using the listability of UnitStep:
Properties & Relations (7)
Listable, in general, functions effectively apply Thread many times:
Applying listable functions to several arrays of equal dimension is equivalent to using MapThread:
Listable functions applied to arrays can be written as a Table:
A function implemented in terms of a listable operation may not need the Listable attribute:
The system symbols with the Listable attribute:
More than half these are arithmetic functions possessing the NumericFunction attribute as well: