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

2 visualizaciones (últimos 30 días)
for i=1:numel(T1)
if T1{i}~=0
Items=union(Items,T1{i});
end
end
~= is not for cell

Respuesta aceptada

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 8 de Dic. de 2019
an example:
T1={{0} {4} {5} {6} {5}}
items=vertcat(T1{cellfun(@(x) ~isequal(x,{0}),T1)});
items=[items{:}];
  2 comentarios
Mira le
Mira le el 8 de Dic. de 2019
Editada: Mira le el 8 de Dic. de 2019
T1 is like that
>> T1
T1 =
9×1 cell array
[1×3 double]
[1×2 double]
[1×2 double]
[1×3 double]
[1×2 double]
[1×2 double]
[1×2 double]
[1×4 double]
[1×3 double]
How I can use this function that you mentioned above
please help me
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 8 de Dic. de 2019
items=cell2mat(horzcat(T1{:}));
items(items==0)=[]

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by