getting rid of empty cells in a cell array
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (1)
Mischa Kim
il 15 Gen 2014
Modificato: Mischa Kim
il 15 Gen 2014
3 voti
Try y=x(~cellfun('isempty',x))
4 Commenti
Sebastiano delre
il 15 Gen 2014
Kanthaswamy Ganapathy
il 4 Mag 2021
Thank you . How do I extend this to work for a n-d cell array
Yiqian Qian
il 27 Mag 2021
I have the same question above, how to apply this to a specific row or colums.
Nisha Bharti
il 10 Ott 2021
Yes, same query
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!