MathGroup Archive 1997

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

Search the Archive

Re: Using Fold in Select

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9061] Re: [mg9035] Using Fold in Select
  • From: Olivier Gerard <jacquesg at pratique.fr>
  • Date: Thu, 9 Oct 1997 01:42:41 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

At 06:05 +0200 97.10.08, Ramin Sina wrote:
> Hi all,
>
> I am trying to write a fuction that does the following:
>
> f[n_]:=Select[thedata,(
>           #[[1]]<fitmax[1,g[n]]  &&
>           #[[2]]<fitmax[2,g[n]]  &&
>            ...................   &&
>           #[[n]]<fitmax[n,g[n]]
>                        ) &]
>
> thedata is a 100 by 1000 matrix.

Ramin,

you can Apply And on a list of tests. For example

Function[ data, And@@Table[ data[[i]] < fitmax[i,g[n]], {i,1,n}]]

gives you a function making a list of tests on the input "data".


Olivier





  • Prev by Date: list manipulation problem
  • Next by Date: anti-aliasing MMA graphics
  • Previous by thread: Using Fold in Select
  • Next by thread: How write the result of Table[NSolve...] into a text file can be read by Excel