How to automatically delete empty cell arrays generated from a script
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
xander fong
le 21 Juil 2015
Commenté : James Tursa
le 21 Juil 2015
Hey, so I have a script that filters through a large excel spreadsheet and sorts data based on criteria. It returns around 17 files, with each cell being an embedded matrix. However, some of the files are completely empty due to the fact that nothing may fit the certain criteria. How do I code to automatically delete every empty cell array generated?
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 21 Juil 2015
Modifié(e) : Azzi Abdelmalek
le 21 Juil 2015
v={2 3 [] 5}
idx=cellfun(@isempty,v)
v(idx)=[]
2 commentaires
James Tursa
le 21 Juil 2015
The last part deletes it ... it is a special syntax that MATLAB uses for deleting elements.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets 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!