delete rows with a special number
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi ,
can someone please help me to delete the entire rows with 99?
A=
[ 0.0125 0.9025
99.0000 99.0000
99.0000 99.0000
99.0000 99.0000
99.0000 99.0000
0.1162 0.0176
99.0000 99.0000
99.0000 99.0000
99.0000 99.0000
99.0000 99.0000]
thanks.
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 22 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 22 Mär. 2013
A(any(A==99,2),:)=[]
4 Kommentare
Matt Tearle
am 22 Mär. 2013
To clarify: the 2 is a dimension argument for the any function. A==99 produces a matrix of logical values (T/F). By default any(A==99) applies an OR operation down each column, independently. So any(A==99,2) changes that to an OR operation across each row. The result is a column vector that is true wherever there's a 99 in the corresponding row of A.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical 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!