Adressing
    6 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Hello, If i have:
   A=[1 2 3 ;7 5 3;9 8 3;11 53 45]
   A =
     1     2     3
     7     5     3
     9     8     3
    11    53    45
and i do
>> A(9)
ans =
     3
How can i know the row and coloumn through its index value ???
Thanks
0 Commenti
Risposta accettata
  Fangjun Jiang
      
      
 il 27 Set 2011
        help sub2ind
help ind2sub
[row,col]=ind2sub(size(A),9)
I guess you mean this:
A=[1 2 3 ;7 5 3;9 8 3;11 53 45];
[Row,Col]=find(A==9)
3 Commenti
  Fangjun Jiang
      
      
 il 27 Set 2011
				What do you mean? You can't run this?
A=magic(3);[row,col]=ind2sub(size(A),9)
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Matrix Indexing in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

