Re: Map

• To: mathgroup at smc.vnet.net
• Subject: [mg130915] Re: Map
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Sat, 25 May 2013 05:38:59 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```On 5/24/13 at 6:25 AM, djpmorris at googlemail.com (Jon Morris) wrote:

>I'm new to Mathematica and I've been given some code to help me
>analyse some data. I'm trying to understand what the Map function
>does, specifically what the {2,2} means?

>qbarlist = Map[(# - bragg) &, hkllist,{2, 2}];

>hklist is a 3 column list, bragg is a three element vector.

>When I try the same line with {2} or {1} I seem to get the same
>answer. The online explanation of this term does not make that much
>sense to me. I'd be very grateful if someone could explain the
>purpose of the last term of the Map syntax.

The {2,2} refers to the level of hklist to map the function
(#-bragg)& onto

In the form {n,m} Mathematica will map the specified function to
levels n through m. In the form {n} Mathematica will map the
specified function at level n only. So, using {n,n} is exactly
equivalent to {n}.

searching on Level in the Documentation Center. And if you do
so, don't fail to scroll down to the bottom of the page returned
to find two tutorials that give more details.

```

• Prev by Date: Re: Reduce an expression into a given form.
• Next by Date: insert graph
• Previous by thread: Re: Map
• Next by thread: Re: Map