In a cell with matrix entries, loop through to delete empty matrices

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!

 採用された回答

Conrad
Conrad 2012 年 7 月 13 日

1 投票

Let R denote your cell array that contains the matrices, then the following should suffice:
K = R(~cellfun(@isempty,R));
Conrad

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2012 年 7 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by