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 2.05875

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100396] Re: Min function returns Min[2.05875,] instead of just 2.05875
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Tue, 2 Jun 2009 06:47:39 -0400 (EDT)

On 6/1/09 at 7:12 AM, davide.guarisco at gmail.com (dg) 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?

There is at least one entry in your matrix that does not have a
numeric value. Quite likely, this is a Null. This can happen
when you read data in from a CSV file using Import and there is
an extra comma somewhere.

You can verify this to be the case by doing

Union[Head/@Flatten[data]]

>How can I get just the number from the result?

Obviously, the best choice would be to fix the problem of a
non-numeric entry. However, the numeric value can be extracted
in a number of ways such as

In[2]:= Cases[List @@ Min[2.05875,], _?NumericQ][[1]]

Out[2]= 2.05875



  • Prev by Date: Re: comments on Wolfram Alpha
  • Next by Date: Re: RandomReal gets stuck
  • Previous by thread: Re: Min function returns Min[2.05875,] instead of just 2.05875
  • Next by thread: Re: Min function returns Min[2.05875,] instead of just 2.05875