Cell array without empty variables
显示 更早的评论
I need to create a new cell array using values from another, but excluding the empty values for example... [] 2 [] 1 I would like to have a new a cell array that only includes the 2 and the 1 and skip the empty values. so the final would just read...2 1
采纳的回答
更多回答(1 个)
John D'Errico
2016-4-22
0 个投票
Use cellfun with isempty to identify those cells that are empty. Then just delete those elements like you would delete elements of any other array.
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!