Effacer les filtres
Effacer les filtres

How to delete rows from a CELL with certain values?

3 vues (au cours des 30 derniers jours)
Akhil  Reddy
Akhil Reddy le 9 Juin 2016
Commenté : Jos (10584) le 9 Juin 2016
It has thousands of rows and I want to remove any row with 0 or 99 or 999 in the row 12 and 13

Réponse acceptée

Jos (10584)
Jos (10584) le 9 Juin 2016
Similar question, similar answer ...
You should be able to modify the code from that one!
If you do not understand it, just ask for some more explanation...
  2 commentaires
Akhil  Reddy
Akhil Reddy le 9 Juin 2016
what if i need to check values from particular column?
Jos (10584)
Jos (10584) le 9 Juin 2016
Fair enough. You can select the columns first:
A_selected = A(:, [ 12 13]) ;
tf = ~any(cellfun(@(x) isequal(x,0) || isequal(x,99),A_selected, 'un',1),2) ;
B = A(tf,:) ;

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by