How i check cell in cell array is different of 0?

3 views (last 30 days)
for i=1:numel(T1)
if T1{i}~=0
Items=union(Items,T1{i});
end
end
~= is not for cell

Accepted Answer

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 8 Dec 2019
an example:
T1={{0} {4} {5} {6} {5}}
items=vertcat(T1{cellfun(@(x) ~isequal(x,{0}),T1)});
items=[items{:}];
  2 Comments

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by