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


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

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

From Heike Gramberg <heike.gramberg@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: can't find info about & /@ %
Date 2011-10-06 08:37 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j6jpcl$mdn$1@smc.vnet.net> (permalink)
References <201110050759.DAA06921@smc.vnet.net>

Show all headers | View raw


& 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
>

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


Thread

Re: can't find info about & /@ % Heike Gramberg <heike.gramberg@gmail.com> - 2011-10-06 08:37 +0000

csiph-web