corresponding index of an element
Mostrar comentarios más antiguos
I have two vectors
g_counter = [2 0]
and
list = [3 0]
I would get the indices of all the elements belong to g_counter that have their position setted to zero and the corresponding position of list vector has to be setted to 0.
For instance with the given vectors I would get 2 as index. How can I do?
1 comentario
Azzi Abdelmalek
el 10 de Nov. de 2012
your question is not clear
Respuesta aceptada
Más respuestas (1)
idx = find(g_counter == 0 & list == 0);
or
idx = find(~g_counter & ~list);
or
idx = find(g_counter - list == g_counter + list);
1 comentario
Salvatore Mazzarino
el 10 de Nov. de 2012
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!