Effacer les filtres
Effacer les filtres

non zero elements in matrix

3 vues (au cours des 30 derniers jours)
Mo H
Mo H le 3 Avr 2020
Commenté : Mo H le 3 Avr 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

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 3 Avr 2020
[r,c]=find(mat~=0)
  1 commentaire
Mo H
Mo H le 3 Avr 2020
you are awesome

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by