getting rid of empty cells in a cell array
Mostrar comentarios más antiguos
Hi,
can you please help me with this? I have the following cell array
x = {1,[],'ciao',[],[]};
I want to exclude the empty cells, and get another array like this:
y = {1,'ciao'};
Thank you!
Respuesta aceptada
Más respuestas (1)
Mischa Kim
el 15 de En. de 2014
Editada: Mischa Kim
el 15 de En. de 2014
3 votos
Try y=x(~cellfun('isempty',x))
4 comentarios
Sebastiano delre
el 15 de En. de 2014
Kanthaswamy Ganapathy
el 4 de Mayo de 2021
Thank you . How do I extend this to work for a n-d cell array
Yiqian Qian
el 27 de Mayo de 2021
I have the same question above, how to apply this to a specific row or colums.
Nisha Bharti
el 10 de Oct. de 2021
Yes, same query
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!