Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14622 > unrolled thread

Re: Map

Started byBill Rowe <readnews@sbcglobal.net>
First post2013-05-25 09:32 +0000
Last post2013-05-25 09:32 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Map Bill Rowe <readnews@sbcglobal.net> - 2013-05-25 09:32 +0000

#14622 — Re: Map

FromBill Rowe <readnews@sbcglobal.net>
Date2013-05-25 09:32 +0000
SubjectRe: Map
Message-ID<knq0et$58k$1@smc.vnet.net>
On 5/24/13 at 6:25 AM, djpmorris@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}.

You can get more information about levels in expressions by
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.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web