MathGroup Archive 1998

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

Search the Archive

Re: Sorting of Data Lists 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.
> Thank you.
> Dr. Christopher J. Freitas
> Principal Engineer - Computational Mechanics Southwest Research
> Institute
> Voice: 210-522-2137, Fax: 210-522-3042

Here is the kind of data you have, right?:


First group the two lists into a list of lists. both={a,b}

both is essentially an array with two rows of 25 numbers each.  The
of this array is an array with 25 rows, each with two numbers, the 
corresponding entries in a and b.


Now it's easy to pick the maximum from each pair to get the desired

Ken Levasseur
Math. Sci.
UMass Lowell

  • Prev by Date: Re: ANNOUNCE: Math::ematica 1.105 - Perl talks to Mathematica talks to Perl
  • Next by Date: Forcing Mathematica 3.0 to display a superscript 1/2 rather than a square root sign
  • Prev by thread: Re: Sorting of Data Lists
  • Next by thread: Re: Sorting of Data Lists