How to remove empty cells from array
268 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm very new to matlab :)
How can I remove the empty cells from the array in the attached image?
I have tried data(~cellfun('isempty',data)), but this didn't work.
Thank you for the help.
4 件のコメント
Stephen23
2021 年 8 月 23 日
@Daneisha Blair: yes,
data(cellfun(@isempty,data))=[];
is probably the best way to do this.
回答 (1 件)
KSSV
2021 年 8 月 23 日
If C is your cell array, you can remove the empty cells using:
C = C(~cellfun('isempty',C)) ;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!