MathGroup Archive 1997

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

Search the Archive

Re: Using Fold in Select


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