Borrar filtros
Borrar filtros

non zero elements in matrix

1 visualización (últimos 30 días)
Mo H
Mo H el 3 de Abr. de 2020
Comentada: Mo H el 3 de Abr. de 2020
Hello,
I have a matrix 50*50 and every single elements has a value of either '0' or '1' . How can I determine all locations of all non zero elements. It would be nice if I could store the location in an array or something easy to read and understand.
Thank you

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 3 de Abr. de 2020
[r,c]=find(mat~=0)

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by