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


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

Re: Map

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Map
Date 2013-05-25 09:32 +0000
Message-ID <knq0et$58k$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web