Effacer les filtres
Effacer les filtres

Delete rows from cell array

2 vues (au cours des 30 derniers jours)
David du Preez
David du Preez le 1 Juil 2016
Commenté : David du Preez le 1 Juil 2016
I have a cell array of 11x8761 and I want to delete entire rows when the value in column 9 or 6 are equal to []. How do I delete the rows without deleting the entire column as well?

Réponse acceptée

Guillaume
Guillaume le 1 Juil 2016
emptycells = cellfun(@isempty, yourcellarray); %find empty cells in the whole cell array
yourcellarray(any(emptycells(:, [6 9]), 2), :) = []; %remove rows for which any of column 6 or 9 is empty
  1 commentaire
David du Preez
David du Preez le 1 Juil 2016
Thanks Guillaume that works.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Cell 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