Nesting functional commands
- To: mathgroup at smc.vnet.net
- Subject: [mg102875] Nesting functional commands
- From: Erin Noel <enoel2 at gmail.com>
- Date: Tue, 1 Sep 2009 03:51:31 -0400 (EDT)
Hi, So how would you go about nesting a functional command inside of another functional command? For example, say A={1,2,3,4}, then 3*#&/@A = {3,6,9,12}. No problem. But then what if, within that vector {3,6,9,12}, I wanted to use the Select command to choose elements less than, say 7. The command Select[3*#&/@A,#<7&] doesn't work because, as far as I can tell, Mathematica doesn't know which "#" belongs to Select and which "#" belongs to the &/@ mapping over A. I know that I could define 3*#&/@A as a new variable and then use that new variable in the Select command, but is there any way to nest multiple commands in this way? Thanks a lot in advance, Erin
- Follow-Ups:
- Re: Re: Nesting functional commands
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Nesting functional commands
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Nesting functional commands
- From: "Elton Kurt TeKolste" <tekolste@fastmail.us>
- Re: Nesting functional commands
- From: Patrick Scheibe <pscheibe@trm.uni-leipzig.de>
- Re: Re: Nesting functional commands