Apply a function to a list of elements - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : MTM Package : MTM/Map

MTM[Map] - Apply a function to a list of elements

Calling Sequence

Map(f,M1,...,Mn)

Map[k](f,M1,...,Mn)

Parameters

f

-

procedure

M1,...,Mn

-

Array, list, set, scalar

k

-

(optional) positive integer

Description

• 

The function Map(f,M1,...,Mn) applies the function f to each element of M1, with extra arguments M2,...,Mn.

• 

The function Map[k](f,M1,...,Mn) applies the function f to each element of Mk, with extra arguments M1,...,Mk-1,Mk+1,...,Mn.

• 

For scalar Mk, the function Map[k](f,M1,...,Mn) is equivalent to f(M1,...,Mn).

Examples

withMTM:

M:=Matrix1,2,3,4:

Mapa→a2,M

14916

(1)

Mapa→a2,b+c

b+c2

(2)

Map2`+`,a,b,c,d

a+b+d,a+c+d

(3)

See Also

Array, array, map, zip, MTM[Zip]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam