How to automatically delete empty cell arrays generated from a script
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2015-7-21
编辑:Azzi Abdelmalek
2015-7-21
v={2 3 [] 5}
idx=cellfun(@isempty,v)
v(idx)=[]
2 个评论
James Tursa
2015-7-21
The last part deletes it ... it is a special syntax that MATLAB uses for deleting elements.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!