omitting data from a cell array
2 次查看(过去 30 天)
显示 更早的评论
I have a cell array
A = cell 1: 1,2,5,6 (4x1)
cell 2: 3, 5.5, 6.4, 3, 7.2 (5x1)
cell 3: 2, 13 (2x1)
cell 4: 15 (1x1)
cell 5: 2, 3.25, 6.35 (3x1)
I want to get rid of any cell that has under 3 elements, so the new cell array should have only cells 1,2,5
Thanks
0 个评论
采纳的回答
Azzi Abdelmalek
2015-4-14
n={ [1 2 5 6] ,[3 5.5 6.4 3 7.2] ,[2 13] ,15, [2 3.25 6.35] }
out=n(cellfun(@numel,n)>=3)
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!