Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Simple matrix manipulation question
Date: Thu, 16 Jul 2009 20:32:03 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 9
Message-ID: <h3o2o3$7g4$1@fred.mathworks.com>
References: <h3lt89$b6e$1@fred.mathworks.com> <h3o275$2h9$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1247776323 7684 172.30.248.35 (16 Jul 2009 20:32:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Jul 2009 20:32:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:556086


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

Bruno