MathGroup Archive 1998

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

Search the Archive

Re: Sorting of Data Lists


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11065] Re: Sorting of Data Lists
  • From: Bill Bertram <wkb@ansto.gov.au>
  • Date: Wed, 18 Feb 1998 20:32:18 -0500
  • Organization: ANSTO
  • References: <6camtn$fe8@smc.vnet.net>

CFreitas@swri.edu wrote:
> 
> I have two equal length vector sets of data.  I wish to form a third vector
> whose elements are the minimum values from each component of the other two
> vectors; i.e., if a(i) < b(i), then c(i) = a(i), else c(i) = b(i).  

Try this,

  lista = {1,3,2,5,8,4,6,9,2,5,1,2};
  listb = {2,1,4,3,7,2,8,4,3,2,5,1};
  listc = Table[Min[la[[i]],lb[[i]]],{i,1,12}]

output:
           {1,1,2,3,7,2,6,4,2,2,1,1}

Hope this helps,
   Bill



  • Prev by Date: Re: Sorting of Data Lists
  • Next by Date: Re: help
  • Prev by thread: Re: Sorting of Data Lists
  • Next by thread: Re: Sorting of Data Lists