From help-octave-request at bevo dot che dot wisc dot edu Tue Apr 24 08:41:41 2001 Subject: Re: replacing NaN From: Paul Kienzle To: david barnes Cc: kai dot habel at gmx dot de, help-octave@bevo.che.wisc.edu Date: Tue, 24 Apr 2001 14:41:30 +0100 The single index problem can be solved by moving to the most recent release of octave. If that is too much trouble, you can just do: do_fortran_indexing = 1; In a library function, you should wrap the do_fortran_indexing in an unwind_protect: dfi = do_fortran_indexing; unwind_protect do_fortran_indexing = 1; ... unwind_protect_cleanup do_fortran_indexing = dfi; end_unwind_protect I am very happy that this is no longer needed. Paul Kienzle pkienzle at kienzle dot powernet dot co dot uk On Tue, Apr 24, 2001 at 02:13:00PM +0100, david barnes wrote: > > Hi Kai! > > Kai Habel wrote: > > > > > M = [2 3;NaN 4] > > > > M(isnan(M)) = 0.0 > > I got that far, > but 2 things > you'll get > "error: single index only valid for row or column vector" > and note > NaN * notNaN = NaN > and I can't see > [i,j] = find(isnan(M)) > helping much more > so I've gone for: > line = strrep(line,'NaN','0.0'); > > but thanks anyway ... > 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 > ------------------------------------------------------------- > > ------------------------------------------------------------- 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 -------------------------------------------------------------