How to automatically delete empty cell arrays generated from a script

3 ビュー (過去 30 日間)
xander fong
xander fong 2015 年 7 月 21 日
コメント済み: James Tursa 2015 年 7 月 21 日
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?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 21 日
編集済み: Azzi Abdelmalek 2015 年 7 月 21 日
v={2 3 [] 5}
idx=cellfun(@isempty,v)
v(idx)=[]
  2 件のコメント
xander fong
xander fong 2015 年 7 月 21 日
the last part doesn't delete it, it just makes it empty?
James Tursa
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 ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by