Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

get indices where the value is 0

조회 수: 1 (최근 30일)
Shathesh Kumar
Shathesh Kumar 2020년 6월 29일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
I need a fucntion that return all the indices where the value is 0. I can use a for loop for finding the indices but is there any easier way like predefined function or something

답변 (1개)

KSSV
KSSV 2020년 6월 29일
편집: KSSV 2020년 6월 29일
Let A be your vector....to get indices of zero use...
idx = find(A==0) ; % gives indices directly
idx_l = A==0 ; % gives logical indices

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by