finding all the other elements of a cell vector apart from zeros and empties

1 次查看(过去 30 天)
Dear all,
I want to find all the elements of a cell vector apart from zeros and empties Using the command
ismember(mm,setdiff(mm,'0' ))
I find all the elements apart from zeroes. But I want to find all the elements apart from zeroes AND empty cells. Note mm is a cell of dimension 1000 by 1
thanks

采纳的回答

Walter Roberson
Walter Roberson 2012-6-4
mm( ~ cellfun( @(C) isempty(C) || (ischar(C) && strcmp(C, '0')), mm ) )
  4 个评论
Walter Roberson
Walter Roberson 2012-6-4
mm( ~ cellfun( @(C) isempty(C) || (ischar(C) && strcmp(C, '0')), mm ) & strcmp(mdata1(:,6),'b1') )

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by