Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news2!postnews.google.com!i24g2000prf.googlegroups.com!not-for-mail
From: Brian Borchers <borchers.brian@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to judge a large matrix containing a Nan?
Date: Wed, 31 Dec 2008 23:31:00 -0800 (PST)
Organization: http://groups.google.com
Lines: 13
Message-ID: <2929a11c-b0d1-4e3e-a35a-516ccb00d6f4@i24g2000prf.googlegroups.com>
References: <gjhqc5$2k9$1@fred.mathworks.com>
NNTP-Posting-Host: 71.222.214.89
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1230795060 13853 127.0.0.1 (1 Jan 2009 07:31:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 1 Jan 2009 07:31:00 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: i24g2000prf.googlegroups.com; posting-host=71.222.214.89; 
	posting-account=EmSEdgoAAABmAH5eEkFTCMiZ14RLEfpQ
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) 
	Gecko/20081216 Ubuntu/7.10 (gutsy) Firefox/2.0.0.19,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:509399


On Jan 1, 12:12 am, "zedong  " <zdon...@gmail.com>
>How to judge that A(i,j) is Nan?

The isnan() function will do this for you.  In particular,

nnz(isnan(A))

will tell you how many NaN's are in the matrix A, while

isnan(A)

will give you a sparse matrix with 1's in the same positions as the
NaN's in A.