필터 지우기
필터 지우기

Remove cells with spaces from cell array

조회 수: 19 (최근 30일)
Mohit
Mohit 2014년 3월 12일
답변: Andrei Bobrov 2014년 3월 12일
Hi,
I am trying to remove cells with just a space in them (and no other text or number) from a cell array (100 by 200) but am unable to do so with below command as I get error.
core_data(cell2mat(core_data)==' ')=[];
??? Error using ==> cell2mat at 47
All contents of the input cell array must be of the same data type.
My cell array has strings as well as numeric data. Please help!

채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 3월 12일
out = core_data(~cellfun(@(x)strcmp(' ',x),core_data));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by