Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

get indices where the value is 0

1 visualizzazione (ultimi 30 giorni)
Shathesh Kumar
Shathesh Kumar il 29 Giu 2020
Chiuso: MATLAB Answer Bot il 20 Ago 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

Risposte (1)

KSSV
KSSV il 29 Giu 2020
Modificato: KSSV il 29 Giu 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

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by