필터 지우기
필터 지우기

removing zeros

조회 수: 8 (최근 30일)
Trader
Trader 2012년 4월 6일
short = cell and it contains mostly numbers:
[ 0]
[ 0]
[ 0]
[-673.12]
[ 0]
[ 0]
[ 0]
[ 0]
[ 0]
how do you clear zeros out of a cell array? when I try short(short == 0) = []; I get this error:
Undefined function 'eq' for input arguments of type 'cell'.

답변 (1개)

Jan
Jan 2012년 4월 6일
C = {0, -673.12, 0};
C = C(cellfun(@any, C));

카테고리

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