From: Magnus Lilledahl on 3 May 2010 14:33 I want to find the indicies of the maximum value in an image/matrix c and do it like this: [d,i] = max(c); [e,j] = max(d); col = i(j); row = j; This seems like a lot of code for a simple task. How could this be achieved with more condensed (prettier) code? Magnus
From: Bruno Luong on 3 May 2010 14:44 "Magnus Lilledahl" <mlilledahl(a)gmail.com> wrote in message <hrn4t6$msd$1(a)fred.mathworks.com>... > I want to find the indicies of the maximum value in an image/matrix c and do it like this: > > [d,i] = max(c); > [e,j] = max(d); > col = i(j); > row = j; > There is a similar thread posted recently: http://www.mathworks.com/matlabcentral/newsreader/view_thread/280760 Bruno
From: us on 3 May 2010 14:56 "Magnus Lilledahl" <mlilledahl(a)gmail.com> wrote in message <hrn4t6$msd$1(a)fred.mathworks.com>... > I want to find the indicies of the maximum value in an image/matrix c and do it like this: > > [d,i] = max(c); > [e,j] = max(d); > col = i(j); > row = j; > > This seems like a lot of code for a simple task. How could this be achieved with more condensed (prettier) code? > > Magnus a hint: help max; % <- then, look at the second output arg... us
From: ImageAnalyst on 3 May 2010 15:55 Not sure what d is, but if you just want to "find the indicies of the maximum value in an image/matrix c" like you said, then how about this: [rows columns] = find(c == max(max(c)));
|
Pages: 1 Prev: Cross correlation to find time lag by employing chirp signal Next: Running shell commands... |