How to find all zero values in a matrix?

443 Ansichten (letzte 30 Tage)
afrya
afrya am 12 Dez. 2013
Kommentiert: Zaid Al-Wardi am 9 Jun. 2021
Hello,
I am wondering first how can I do to detect the number of zero values and their position in a large matrix.Secondly, how can i delete it.
Exemple:
A=
1 0,1 1
2 0.7 0
3 0.9 2
4 1.7 0
Number of zero values:2
position: A(2,3);A(4,3)
Thanks in advance

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 12 Dez. 2013
Bearbeitet: Azzi Abdelmalek am 12 Dez. 2013
A=[1 0.1 1;2 0.7 0;3 0.9 2;4 1.7 0]
[ii,jj]=find(~A)
  6 Kommentare
Victor Castillo
Victor Castillo am 23 Apr. 2021
Bearbeitet: Victor Castillo am 23 Apr. 2021
genius...
Zaid Al-Wardi
Zaid Al-Wardi am 9 Jun. 2021
nice

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Automotive finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by