How i check cell in cell array is different of 0?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mira le
am 8 Dez. 2019
Kommentiert: JESUS DAVID ARIZA ROYETH
am 8 Dez. 2019
for i=1:numel(T1)
if T1{i}~=0
Items=union(Items,T1{i});
end
end
~= is not for cell
0 Kommentare
Akzeptierte Antwort
JESUS DAVID ARIZA ROYETH
am 8 Dez. 2019
an example:
T1={{0} {4} {5} {6} {5}}
items=vertcat(T1{cellfun(@(x) ~isequal(x,{0}),T1)});
items=[items{:}];
2 Kommentare
JESUS DAVID ARIZA ROYETH
am 8 Dez. 2019
items=cell2mat(horzcat(T1{:}));
items(items==0)=[]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!