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