フィルターのクリア

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 Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by