MathGroup Archive 1998

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

Search the Archive

Re: Sorting of Data Lists


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11033] Re: Sorting of Data Lists
  • From: Paul Abbott <paul@physics.uwa.edu.au>
  • Date: Wed, 18 Feb 1998 20:31:33 -0500
  • Organization: University of Western Australia
  • 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).  

In[1]:= a=Table[Random[],{5}]
Out[1]= {0.771977,0.811453,0.917575,0.958207,0.582124}

In[2]:= b=Table[Random[],{5}]
Out[2]= {0.230583,0.394757,0.102314,0.225975,0.447643}

In[3]:= c=Min/@Transpose[{a,b}]
Out[3]= {0.230583,0.394757,0.102314,0.225975,0.447643}

Cheers,
	Paul 
 
____________________________________________________________________ 
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907       
mailto:paul@physics.uwa.edu.au  AUSTRALIA                            
http://www.pd.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________



  • Prev by Date: Forcing Mathematica 3.0 to display a superscript 1/2 rather than a square root sign
  • Next by Date: Importing .pix files .
  • Prev by thread: Re: Sorting of Data Lists
  • Next by thread: visual subscripts with assignment