[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replacing NaN
From: |
david barnes |
Subject: |
Re: replacing NaN |
Date: |
Tue, 24 Apr 2001 18:06:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux 2.2.16 i686; en-GB; m18) Gecko/20010131 Netscape6/6.01 |
Hi Etienne,
this only works in latest dev version of octave (I hear),
otherwise:
%> m = [1 2 nan; 3 4 inf; 5 nan 6];
%> m(find(isnan(m))) = 0
%> error: single index only valid for row or column vector
%> error: evaluating assignment expression near line 2, column 19
Etienne Grossmann wrote:
m = [1, 2, nan;3, 4,inf;5,nan,6];
m(find(isnan(m))) = 0
m =
1 2 0
3 4 Inf
5 0 6
Etienne
David
--
David DS Barnes
MED | Imperial College | Exhibition Rd | London sw7 2bx
t/f:0207 594 7181/7127
tap vein, mine deep, share gold
-------------------------------------------------------------
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
-------------------------------------------------------------