Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

get indices where the value is 0

1 visualización (últimos 30 días)
Shathesh Kumar
Shathesh Kumar el 29 de Jun. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (1)

KSSV
KSSV el 29 de Jun. de 2020
Editada: KSSV el 29 de Jun. de 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

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by