MathGroup Archive 2005

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

Search the Archive

Re: # question


Use a helper function

sel[x_List, y_?NumericQ, op_Symbol]:=
    Select[x,op[#,y]&];

lst1={2,3,6,1,0};
lst2={2,5,3};

sel[lst1,#,Less]&/@lst2

{{1,0},{2,3,1,0},{2,1,0}}

(Complement[lst1,#]&/@%)==
  (sel[lst1,#,GreaterEqual]&/@lst2)

True


Bob Hanlon

> 
> From: "ekantian" <ekantian at yahoo.com>
To: mathgroup at smc.vnet.net
> Date: 2005/09/08 Thu AM 04:53:11 EDT
> Subject: [mg60256] [mg60233] # question
> 
> how do i manage overlapping #?
> 
> i.e.
> 
> Map[
>   Select[{2, 3, 6, 1, 0}, # < # &],
>   {2, 5, 3}]
> 
> 
> which i would like to return {{1,0},{2,3,1,0},{2,1,0}}
> 
> thx.
> 
> 


  • Prev by Date: Re: # question
  • Next by Date: Re: rootsearch in a piecewise function
  • Previous by thread: Re: # question
  • Next by thread: Notebook in LaTex