From: LFG Tech on 15 Mar 2010 04:00 Hello, I want to find the maximum value and the coordinate of that value of amatrix. eg x = [1 2 3 4; 2 3 4 5; 4 5 6 7; 9 6 5 4]; using max(max(x)). I get 9. I want the coordinates of '9'(in this case 4,1. how can I achieve that? Regards, LFG.
From: James Tursa on 15 Mar 2010 04:22 "LFG Tech " <vinodkaruvat(a)gmail.com> wrote in message <hnkpen$he7$1(a)fred.mathworks.com>... > Hello, > > I want to find the maximum value and the coordinate of that value of amatrix. > > eg x = [1 2 3 4; > 2 3 4 5; > 4 5 6 7; > 9 6 5 4]; > > using max(max(x)). I get 9. I want the coordinates of '9'(in this case 4,1. > > how can I achieve that? > > Regards, > LFG. [C X] = max(x(:)); [I J] = ind2sub(size(x),X); James Tursa
|
Pages: 1 Prev: Wiener deconvolution noise artifacts & noise removal Next: esperanc |