       # RE: Sorting of Data Lists

```
Dr. 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. |
See below.
In:=
lst1={1,9,9,1,1,9,1};
lst2={2,3,2,3,2,3,2};

First I demonstrate what Transose does. In:=
Transpose[{lst1,lst2}]

Out=
{{1,2},{9,3},{9,2},{1,3},{1,2},{9,3},{1,2}}

The next line does the Transpose, and find the Minimum of each. In:=
Map[Min,Transpose[{lst1,lst2}]]

Out=
{1,3,2,1,1,3,1}

The line below is the same thinng using the short hand form. In:=
Min/@Transpose[{lst1,lst2}]

Out=
{1,3,2,1,1,3,1}

Ted Ersek

```

• Prev by Date: RE: Drawing intrinsic coordina
• Next by Date: Re: Sorting of Data Lists
• Prev by thread: Re: Sorting of Data Lists
• Next by thread: Re: Sorting of Data Lists