How do I detect empty cells in a cell array?
Use CELLFUN %# find empty cells emptyCells = cellfun(@isempty,a); %# remove empty cells a(emptyCells) = []; Note: a(i)==[] won’t work. If you want to know whether the the i-th cell is empty, you have to use curly brackets to access the content of the cell. Also, ==[] evaluates to empty, instead of true/false, so you … Read more