Info

この質問は閉じられています。 編集または回答するには再度開いてください。

get indices where the value is 0

2 ビュー (過去 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