MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > Getting the min and max of a matrix 

Subject: Getting the min and max of a matrix From: Diego Zegarra Date: 28 Feb, 2009 18:55:04 Message: 1 of 14 
Hi all, 
Subject: Getting the min and max of a matrix From: Matt Fig Date: 28 Feb, 2009 19:14:02 Message: 2 of 14 
B = [1 4 3; 4 1 2] 
Subject: Getting the min and max of a matrix From: Diego Zegarra Date: 28 Feb, 2009 20:13:01 Message: 3 of 14 
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. 
Subject: Getting the min and max of a matrix From: Roger Stafford Date: 28 Feb, 2009 20:34:01 Message: 4 of 14 
"Diego Zegarra" <diegozbb@gmail.com> wrote in message <goc5sd$bvd$1@fred.mathworks.com>... 
Subject: Getting the min and max of a matrix From: Diego Zegarra Date: 28 Feb, 2009 20:44:01 Message: 5 of 14 
The thing is matrix A has to stay as it is since I need those values in there for later. I cannot just replace by NaN. 
"Diego Zegarra" 
Subject: Getting the min and max of a matrix From: Roger Stafford Date: 28 Feb, 2009 20:54:01 Message: 7 of 14 
"Diego Zegarra" <diegozbb@gmail.com> wrote in message <goc7mh$8er$1@fred.mathworks.com>... 
Subject: Getting the min and max of a matrix From: Diego Zegarra Date: 1 Mar, 2009 03:11:01 Message: 8 of 14 
Is there any way to do this without using a temporary copy of A? 
Subject: Getting the min and max of a matrix From: Matt Fig Date: 1 Mar, 2009 06:24:02 Message: 9 of 14 
You don't have to copy all the matrix a, just the rows of interest. Otherwise, this finds the minimum for a without the index in the first row of b. That is if you never have negative infs in your matrix a. 
Subject: Getting the min and max of a matrix From: Bruno Luong Date: 1 Mar, 2009 08:13:02 Message: 10 of 14 
"Diego Zegarra" <diegozbb@gmail.com> wrote in message <gocuc5$mmf$1@fred.mathworks.com>... 
Subject: Getting the min and max of a matrix From: Diego Zegarra Date: 1 Mar, 2009 17:41:01 Message: 11 of 14 
The thing is that in some cases I will have to look at matrices of size 120x120 and there will be 12 of those (instead of just a matrix A). For example I will have to look first for the minimum and maximum out of the diagonal of those 12 matrices not including the ones in the matrix B. 
Subject: Getting the min and max of a matrix From: Matt Fig Date: 1 Mar, 2009 17:57:01 Message: 12 of 14 
"Diego Zegarra" <diegozbb@gmail.com> wrote in message 
Subject: Getting the min and max of a matrix From: Bruno Luong Date: 1 Mar, 2009 18:07:01 Message: 13 of 14 
"Diego Zegarra" <diegozbb@gmail.com> wrote in message <goehbd$71n$1@fred.mathworks.com>... 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <goeis5$f15$1@fred.mathworks.com>... 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.