Re: Sorting of Data Lists
- To: mathgroup@smc.vnet.net
- Subject: [mg11062] Re: [mg11011] Sorting of Data Lists
- From: Lou Talman <me@talmanl.mscd.edu>
- Date: Wed, 18 Feb 1998 20:32:16 -0500
Christopher J. Freitas 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.
Given a pair of such vectors, e.g.,
a = Table[Random[],{20}]
b = Table[Random[],{20}]
Try
Map[Min, Transpose[{a,b}]]
--Lou Talman