MathGroup Archive 2005

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

Search the Archive

Re: extracting elements from multi-dimensional arrays

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61314] Re: [mg61295] extracting elements from multi-dimensional arrays
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 14 Oct 2005 22:22:56 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

data=Table[{Random[],Random[],Random[]},{20}];

Select[data, 0<#[[1]]<0.5&&0.5<#[[2]]<1&]

{{0.4586453625910254, 0.7079223287574473, 0.19462530614082832}, 
  {0.22222724007320313, 0.979280916270638, 0.27189394505518427}, 
  {0.15871758555627385, 0.7908124612656703, 0.797235661792941}}


Bob Hanlon

> 
> From: "contact at dantimatter.com" <contact at dantimatter.com>
To: mathgroup at smc.vnet.net
> Date: 2005/10/14 Fri AM 05:56:17 EDT
> Subject: [mg61314] [mg61295] extracting elements from multi-dimensional arrays
> 
> Hello all,
> 
> I have an array of the form:
> 
> list={{a1,b1,c1},{a2,b2,c2}...}
> 
> I'd like to get rid of elements of list based on criteria that apply to
> the a's, b's and c's separately.  For example, I'd like to keep the
> elements of list that have the following properties:
> 
> m < a < n
> p < b < q
> 
> I know there's an easy way to do this, but I can't figure it out.  Any
> suggestions?
> 
> Thanks!
> dan
> 
> 


  • Prev by Date: Re: changing the size of the numbers on x-axes
  • Next by Date: surface fitting question
  • Previous by thread: Re: extracting elements from multi-dimensional arrays
  • Next by thread: Re: extracting elements from multi-dimensional arrays