[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing NaN existence in array
From: |
Jaroslav Hajek |
Subject: |
Re: Testing NaN existence in array |
Date: |
Wed, 27 May 2009 10:14:24 +0200 |
2009/5/27 David Kremer <address@hidden>:
> Hello,
>
> I would have a simple way to detect if an array contains NaN. I tried
> isnan(a), but that doesn't work if only one elem isnan.
>
> The purpose is to test it in a boolean expression, like this :
>
> if has_NaN
> break ;
> end ;
>
> But that works only with scalar value.
>
> Please, do you know a mean to do this ?
>
> Thank you very much.
>
> David Kremer
>
any (isnan (a)(:))
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz