getting index of elements
Mostrar comentarios más antiguos
I have two vectors
g_vector = [2 0]
list = [3 0]
I would get the index of elements of g_vector that have their index in list matrix setted to 0. How can I do?
If I do
g_counter(list == 0)
I get 0 element of g_vector but I would have returned index 2 corresponding to the index of 0 in g_vector
1 comentario
Azzi Abdelmalek
el 10 de Nov. de 2012
Respuestas (2)
Matt J
el 10 de Nov. de 2012
find(list==0)
4 comentarios
Salvatore Mazzarino
el 10 de Nov. de 2012
Salvatore Mazzarino
el 10 de Nov. de 2012
Editada: Salvatore Mazzarino
el 10 de Nov. de 2012
Salvatore Mazzarino
el 10 de Nov. de 2012
Editada: Salvatore Mazzarino
el 10 de Nov. de 2012
Matt J
el 10 de Nov. de 2012
find(g_counter==0 & list==0)
Image Analyst
el 10 de Nov. de 2012
Perhaps one of these
index = find(g_counter == list(2))
index = find(g_counter == list(list==0))
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!