Reputation: 14179
I have two vectors
g_counter = [2 0]
and
list = [3 0]
I would get this:
g_counter
that have the corrisponding values equals to zero in list
vector. 2
has the corresponding value in list
vector not to zero so I will not get it. I will get 0
that have the corresponding value in list
vector equals to zero
0
getting the index of this element in g_counter
vector.
2
Upvotes: 0
Views: 174
Reputation: 95948
From what I've understood you should do something like that:
zeros=find(list==0);
g_counter(zeros) %this will print the values for which the index is 0 in the vector list
Upvotes: 1