Delete empty cells in 3 dimensional cell array
3 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I want to delete the empty cells in the cell array of the picture. How do I do it? Thanks in advance!
#Peter
0 件のコメント
回答 (1 件)
dpb
2018 年 9 月 23 日
That's a 2D cell array w/ three columns, not a 3D array.
c=c(~cellfun(@isempty,c));
2 件のコメント
dpb
2018 年 9 月 23 日
編集済み: dpb
2018 年 9 月 23 日
No can do.
Even a cell array itself must be rectangular; it can contain variable-length (including 0) elements in a cell but it, itself as the container is not "jagged".
Nor is there a sparse cell array.
Bestest I see you could do would be to save the one column and a corollary variable of column number.
Or, if it's just the display formatting of the empty brackets, could make that a little less obvious by setting all the empty cells to the empty string instead of empty.
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!