getting rid of empty cells in a cell array
古いコメントを表示
Hi,
can you please help me with this? I have the following cell array
x = {1,[],'ciao',[],[]};
I want to exclude the empty cells, and get another array like this:
y = {1,'ciao'};
Thank you!
採用された回答
その他の回答 (1 件)
Mischa Kim
2014 年 1 月 15 日
編集済み: Mischa Kim
2014 年 1 月 15 日
3 投票
Try y=x(~cellfun('isempty',x))
4 件のコメント
Sebastiano delre
2014 年 1 月 15 日
Kanthaswamy Ganapathy
2021 年 5 月 4 日
Thank you . How do I extend this to work for a n-d cell array
Yiqian Qian
2021 年 5 月 27 日
I have the same question above, how to apply this to a specific row or colums.
Nisha Bharti
2021 年 10 月 10 日
Yes, same query
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!