How to remove an entry within a cell of a cell array

조회 수: 1 (최근 30일)
Konstantinos Tsitsilonis
Konstantinos Tsitsilonis 2019년 1월 26일
댓글: Konstantinos Tsitsilonis 2019년 1월 26일
Hi all,
I have the following cell array:
C = { [1 2] ; [2 3 4 1 3 1 8 9] ; [6 9 8 0 0 2 3] } ;
How can I remove all entries in each cell that are less than or equal to 2, so I can end up with:
C = { [empty] ; [3 4 3 8 9] ; [6 9 8 3] }
I have tried
Cn = cellfun(@(x) x(x <= 2) == [], C, 'UniformOutput', 0)
But for some reason it is not working...
Thanks for your help in advance,
KR,
KMT.

채택된 답변

Stephen23
Stephen23 2019년 1월 26일
cellfun(@(x) x(x>2), C, 'Uni', 0)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by