Prev: Gucci Bags,sunglasses,wallets,hats-40% off and Free shipping at our Gucci outlet online store
Next: To publish report in MATLAB
From: Ish Khan on 15 Jul 2010 01:33 Hi, I have matrix and i want to find the coordinate of the first 1 that appeared in the matrix, that is row and column number, here is my code so far, D = 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 >> [m,n] = size (D) m = 4 n = 7 >> G = find (D, m, 'first') G = 8 13 18 21 >> G = min(find(D,m,'first')) G = 8 I need to gewt the row and column number of this 8, which should be m = 4 and n= 2, but i don't know how to, i know its preety basic, but please help me!
From: Jeff K on 15 Jul 2010 02:07 >> [x y]=find(D==1,1,'first') x = 4 y = 2 Here you go!
From: Ish Khan on 15 Jul 2010 02:21
"Jeff K" <mesta2000(a)hotmail.com> wrote in message <i1m8ic$501$1(a)fred.mathworks.com>... > >> [x y]=find(D==1,1,'first') > x = > 4 > y = > 2 > > Here you go! Thank you soooooo much!!! you are a life saver!!!!! |