How to remove empty cells from array
조회 수: 334 (최근 30일)
이전 댓글 표시
Hi,
I'm very new to matlab :)
How can I remove the empty cells from the array in the attached image?
I have tried data(~cellfun('isempty',data)), but this didn't work.
Thank you for the help.
댓글 수: 4
Stephen23
2021년 8월 23일
@Daneisha Blair: yes,
data(cellfun(@isempty,data))=[];
is probably the best way to do this.
답변 (1개)
KSSV
2021년 8월 23일
If C is your cell array, you can remove the empty cells using:
C = C(~cellfun('isempty',C)) ;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Denoising and Compression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!