Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Mathematica > Structural Operations on Expressions >

Thread

Thread[f[args]]
"threads" f over any lists that appear in args.
Thread[f[args], h]
threads f over any objects with head h that appear in args.
Thread[f[args], h, n]
threads f over objects with head h that appear in the first n args.
  • Functions with attribute Listable are automatically threaded over lists.
  • All the elements in the specified args whose heads are h must be of the same length.
  • Arguments that do not have head h are copied as many times as there are elements in the arguments that do have head h.  »
  • Thread specifies arguments using the standard sequence specification:
Allall elements
Noneno elements
nelements 1 through n
-nlast n elements
{n}element n only
{m,n}elements m through n inclusive
{m,n,s}elements m through n in steps of s
New in 1
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team