How i check cell in cell array is different of 0?
2 次查看(过去 30 天)
显示 更早的评论
for i=1:numel(T1)
if T1{i}~=0
Items=union(Items,T1{i});
end
end
~= is not for cell
0 个评论
采纳的回答
JESUS DAVID ARIZA ROYETH
2019-12-8
an example:
T1={{0} {4} {5} {6} {5}}
items=vertcat(T1{cellfun(@(x) ~isequal(x,{0}),T1)});
items=[items{:}];
2 个评论
JESUS DAVID ARIZA ROYETH
2019-12-8
items=cell2mat(horzcat(T1{:}));
items(items==0)=[]
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!