Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

get indices where the value is 0

2 Ansichten (letzte 30 Tage)
Shathesh Kumar
Shathesh Kumar am 29 Jun. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (1)

KSSV
KSSV am 29 Jun. 2020
Bearbeitet: KSSV am 29 Jun. 2020
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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by