getting index of elements
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Image Analyst
2012년 11월 10일
Perhaps one of these
index = find(g_counter == list(2))
index = find(g_counter == list(list==0))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!