Re: Sorting of Data Lists
- To: mathgroup@smc.vnet.net
- Subject: [mg11040] Re: [mg11011] Sorting of Data Lists
- From: jpk@max.mpae.gwdg.de
- Date: Wed, 18 Feb 1998 20:31:39 -0500
Hi Christopher, try this a=Table[i,{i,1,10}]; b=Table[11-i,{i,1,10}]; the following function will create You c List[]/vector c=Apply[If[#1<#2,#1,#2] &,#] & /@ Transpose[{a,b}] {1,2,3,4,5,5,4,3,2,1} Hope that helps Jens > 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. > Thank you. > > Dr. Christopher J. Freitas > Principal Engineer - Computational Mechanics Southwest Research > Institute > Voice: 210-522-2137, Fax: 210-522-3042 >