Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Getting the min and max of a matrix
Date: Sat, 28 Feb 2009 20:34:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 8
Message-ID: <goc73p$11l$1@fred.mathworks.com>
References: <goc1a7$g2q$1@fred.mathworks.com> <goc2dp$re1$1@fred.mathworks.com> <goc5sd$bvd$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1235853241 1077 172.30.248.37 (28 Feb 2009 20:34:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 28 Feb 2009 20:34:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:521576

"Diego Zegarra" <diegozbb@gmail.com> wrote in message <goc5sd$bvd$1@fred.mathworks.com>...
> As stated on my explanation you only see the first two columns, so first row means only position (1,4) is not allowed and second row only position (4,1) is not allowed. This matrix B will be changing dynamically every iteration. The thrid column means how many iterations that move is not allowed, every iteration it will decrease 1 unit and also the list will set another move to be in the list. Once the third column gets a value of 0, that row will be deleted from matrix B.
> 
> B = [1 4 3; 4 1 2]

  For each of the two column pair of indices in B I would replace the corresponding element in A by 'NaN', as well as all 'inf' values.  Then you can do your normal 'max' and 'min' operations.  These ignore all NaNs.

Roger Stafford