delete rows with a special number

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.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 22 de Mzo. de 2013
Editada: Azzi Abdelmalek el 22 de Mzo. de 2013
A(any(A==99,2),:)=[]

4 comentarios

dav
dav el 22 de Mzo. de 2013
can u explain 2 in A==99, 2. Is it for the dimension ?
thanks
Azzi Abdelmalek
Azzi Abdelmalek el 22 de Mzo. de 2013
Exact
Matt Tearle
Matt Tearle el 22 de Mzo. de 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.
dav
dav el 22 de Mzo. de 2013
thank you very much!

Iniciar sesión para comentar.

Más respuestas (1)

vipul utsav
vipul utsav el 22 de Mzo. de 2013
ind=find(A==99.0000);
A(ind)=0;
A=A;

Categorías

Preguntada:

dav
el 22 de Mzo. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by