[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unique behavior for NaN
From: |
Jaroslav Hajek |
Subject: |
Re: unique behavior for NaN |
Date: |
Wed, 11 Aug 2010 10:52:45 +0200 |
On Wed, Aug 11, 2010 at 9:22 AM, Rik <address@hidden> wrote:
> 8/11/10
>
> Can someone with access to Matlab run the following:
>
> unique([NaN 1 2 1 NaN])
>
> Octave unique output is [1 2 NaN NaN]
> Octave values output is [1 2 NaN]
>
> --Rik
>
IIRC, Octave's is correct. In the Matlab manual this is explained as
"NaN is not equal to itself, hence all NaNs are unique". Take it or
hate it :)
--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz