help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replacing NaN


From: Przemek Klosowski
Subject: Re: replacing NaN
Date: Tue, 24 Apr 2001 09:52:41 -0400

> 
> 
> 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"
> M = [2 3;NaN 4]

yup, you're right: it doesn't work for matrices (I tested on a vector). How 
about

tmp=reshape(M,prod(size(M)))
tmp(isnan(tmp)) = 0.0
M=reshape(tmp,size(M))

> and note
>   NaN * notNaN = NaN

Sure, but why is this a problem?



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]