In a cell with matrix entries, loop through to delete empty matrices
1 次查看(过去 30 天)
显示 更早的评论
I have a 32385x1 cell that contains 32385 matrices. Only 476 of those matrices contain numbers. Is there an easy way to loop through the cell and delete the empty matrices, so only the ones containing numbers remain in the cell (in the same order)?
Thank you!
0 个评论
采纳的回答
Conrad
2012-7-13
Let R denote your cell array that contains the matrices, then the following should suffice:
K = R(~cellfun(@isempty,R));
Conrad
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!