AW: pure functions
- To: mathgroup at smc.vnet.net
- Subject: [mg23285] AW: [mg23237] pure functions
- From: Klamser at t-online.de (Peter Klamser)
- Date: Sun, 30 Apr 2000 21:13:35 -0400 (EDT)
- Disposition-notification-to: "Peter Klamser" <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
exli$t = Transpose[exli]
MapThread[(#1 + #2) &, exli$t, 1]
Regrads, Peter Klamser
Von: Helge Andersson [mailto:helgea at inoc.chalmers.se]
Gesendet: Sonntag, 30. April 2000 04:05
An: mathgroup at smc.vnet.net
Betreff: [mg23237] pure functions
Of all the nice functions such as Map, Mapall, Thread, Apply .... I have
not been able to write a simple code to generate the following
I have a two dimensional list like
Since i like to use the pure function command I would like to map my
pure function with arguments #1,#2,#3,.... on all the sublists in li.
Let me exemplify with a simple pure function that add to numbers.
then I want to get the result
One solution, but not allways suitable for me, is the following
(#1+#2)&[Sequence @@ Transpose[exli]].
I want to get rid of the Transpose command and if possible also making
use of the /@ notation for Map. Since I have seen so many elegant
examples in the mailing lists I hope I can get something out of this.
Finally, When using pure functions inside Mathematica defined functions
such as Select for instance,
why don't we need to specify the argument list after the &sign. I can
figure out that in this case the list sent to the Select command will be
used as argument list for the pure function but how does this work in
general. Which are the functions where this feature is possible?
412 96 Göteborg
Tel. 031-772 8072
Tel. Lab. 031-55 38 67
Fax 031-772 28 53
Prev by Date:
Re: Problem with Plot and Ticks-function
Next by Date:
Re: Re: Please help with a Hypergeometric2F1 problem...
Previous by thread:
[Q] Equation solving?
Next by thread:
Re: Generating Random Values with Do