Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Simple matrix manipulation question
Date: Thu, 16 Jul 2009 20:57:01 +0000 (UTC)
Organization: Xoran Technologies
Lines: 11
Message-ID: <h3o46t$f27$1@fred.mathworks.com>
References: <h3lt89$b6e$1@fred.mathworks.com> <h3o275$2h9$1@fred.mathworks.com> <h3o2o3$7g4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1247777821 15431 172.30.248.35 (16 Jul 2009 20:57:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Jul 2009 20:57:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:556096


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h3o2o3$7g4$1@fred.mathworks.com>...
> > 
> > 
> > Amod=A;
> > Amod( bsxfun(@lt,b,(1:k)) )=nan;
> > c=min(Amod,[],2);
> 
> A remark: When it's possible use alternative number other than NaN. Operation with NaN is usually much slowest. In this specific thread, use Inf.
------

I'd be curious to know why this is true in this case. Surely min() bails out as soon as it sees either an Inf or a Nan. Is there a reason it takes longer to recognize a Nan than an Inf?