Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

RE: how to compact many maps?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70781] RE: [mg70748] how to compact many maps?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 27 Oct 2006 00:28:30 -0400 (EDT)

Arek,

Two possible suggestions:

tab = Table[{Random[], Random[]}, {10}, {5}];

Map[{First[#], f[Last[#]]} &, tab, {2}]

tab /. {a_, b_} -> {a, f[b]}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 

From: Arkadiusz.Majka at gmail.com [mailto:Arkadiusz.Majka at gmail.com]
To: mathgroup at smc.vnet.net

Hi,

For table of the following structure

tab=Table[{Random[],Random[]},{10},{5}]

I want to apply function f to the second argument of list.

I did:

(MapAt[f, #, 2] & /@ #) & /@ tab

How can I do it in a simpler, more compact way?

Thanks,

Arek



  • Prev by Date: RE: How to stop NDSolve on a given curve?
  • Next by Date: Bug in RowReduce of a matrix with symbolic entries
  • Previous by thread: Re: how to compact many maps?
  • Next by thread: Re: how to compact many maps?