Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: can't find info about & /@ %

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121913] Re: can't find info about & /@ %
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Thu, 6 Oct 2011 04:24:31 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201110050759.DAA06921@smc.vnet.net>

& is shorthand for Function. It's used in Postfix notation so expr & is 
the same as Function[expr]. The parameters of the function are denoted 
with #1 (or #), #2, =85 etc.

/@ is short for Map. Instead of using f /@ {a, b, c} you can also write 
Map[f, {a,b,c}] which returns {f[a], f[b], f[c]}.

%, or Out[], gives the last result generated (which in your case is 
probably a list of images).

So in summary, your example could have been written as

First[Map[Function[Options[#, "ColorSpace"]], Out[]]]

Heike.

On 5 Oct 2011, at 09:59, Richard Cohen wrote:

> First[Options[#, "ColorSpace"] & /@ %]
> could someone please explain the use of these  & /@ %
> i've looked everywhere to no avail.
> rich
>




  • Prev by Date: Table NDSolve Plot
  • Next by Date: Table NDSolve Plot
  • Previous by thread: Re: can't find info about & /@ %
  • Next by thread: Re: can't find info about & /@ %