Re: Sorting of Data Lists
- To: mathgroup@smc.vnet.net
- Subject: [mg11059] Re: [mg11011] Sorting of Data Lists
- From: Tomas Garza <tgarza@mail.internet.com.mx>
- Date: Wed, 18 Feb 1998 20:32:14 -0500
Christopher 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). I have tried many different methods within Mathematica
> 3.0 and have not been successful. I would appreciate any suggestions
> as to how to accomplish this task.
Christopher,
Suppose your two equal-length vectors are a and b.
In[1]:= c = Transpose[{a,b}];
In[2]:= c/.{x_,y_} -> Min [{x,y}]
does the trick.
Tomas Garza
Mexico City