Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Min function returns Min[2.05875,] instead of just

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100398] Re: [mg100356] Min function returns Min[2.05875,] instead of just
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 2 Jun 2009 06:48:05 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Your data appears to be corrupted.

data = RandomReal[{0, 5}, {5, 3}];

Min[data]

0.540688

Corrupting the data by deleting a few values

data = {{1.5733129712493588, , 4.207662286059996}, 
     {2.65404709124369, 1.533889203301964, 3.8413829848717214}, 
     {1.3250162293559766, 2.3368229647740275, 1.1694572447354092}, 
     {4.292811846441872, , 1.498928361724178}, 
     {0.5406878915086155, 3.971746766033478, 1.0284392955190462}};

Min[data]

min(0.540688,Null)

Eliminate Nulls

Min[(data // Flatten) /. Null :> Sequence[]]

0.540688

Or more generally, use only numeric values

Min[Cases[data // Flatten, _?NumericQ]]

0.540688

Try this latter method with your data


Bob Hanlon

---- dg <davide.guarisco at gmail.com> wrote: 

=============
I have an matrix "data" with 17x248 real numbers.

When I enter  Min[data], I get
Min[2.05875, ] as a result, instead of just the number 2.05875.

This is Mathematica 7.0.1 on Mac OS X.

Why?

How can I get just the number from the result?

TIA



  • Prev by Date: Re: Reading Fortran Data file
  • Next by Date: Graphics saving nightmare
  • Previous by thread: Re: proper way of posing a non-autonomous ode in mathematica?
  • Next by thread: Graphics saving nightmare