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$>
References: <goc1a7$g2q$> <goc2dp$re1$> <goc5sd$bvd$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1235853241 1077 (28 Feb 2009 20:34:01 GMT)
NNTP-Posting-Date: Sat, 28 Feb 2009 20:34:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:521576

"Diego Zegarra" <> wrote in message <goc5sd$bvd$>...
> 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