[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: handling NaN
From: |
John W. Eaton |
Subject: |
Re: handling NaN |
Date: |
Wed, 31 Jul 2002 12:59:34 -0500 |
On 31-Jul-2002, Ben Harris <address@hidden> wrote:
| Here is how I would solve this problem--one extra line of code, MATLAB
| compatible too:
|
|
| octave:14> f = [1 2 3 NaN]
| f =
|
| 1 2 3 NaN
|
| octave:15> idx = find(~isnan(f));
| octave:16> max(f(idx))
| ans = 3
But without using loops, is there also a way to do this along a
particular dimension of a matrix when each column/row/etc. may have a
different number of NaNs?
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------