MathGroup Archive 2007

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

Search the Archive

Re: functional programming

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75160] Re: [mg75132] functional programming
  • From: bsyehuda at gmail.com
  • Date: Thu, 19 Apr 2007 04:27:25 -0400 (EDT)
  • References: <200704180900.FAA08243@smc.vnet.net>

tsome = {{35, 38}, {2064, 2068}, {2182, 2183}};
f[var_] := Select[tsome, var - 1281 <= #1[[2]] <=
     1280 & ]
valList = {1, 2, 20, 1290, 3000}
f /@ valList

yehuda

On 4/18/07, Raj <rajanikanth at gmail.com> wrote:
>
> Could somebody tell me how to do this
>
> tsome = {{35, 38}, {2064, 2068}, {2182, 2183}};
> Select[tsome, 1280 - 1281 =E2=89=A4 #[[2]] =E2=89=A4 1280 &]
>
> Now instead of using 1280 in the Select function, I want to use a
> variable and get the values as this variable varies. I know that a
> Table can be used and the value of the variable can be varied. But if
> possible, I want to do it in a "Truly functional way".
>
> for example something like
>
> Select[tsom, var-1281<=#[[2]]<=1280&]&/@{list of values over which the
> variable varies}
>
> Thanks,
>
> Raj
>
>
>



  • Prev by Date: Re: Overlaying 3d plots
  • Next by Date: Re: Eliminate white border around DensityPlot?
  • Previous by thread: Re: functional programming
  • Next by thread: Re: functional programming