@JB, Stephen's comment is spot on. It may not seem like a big deal to you but your language and your syntax is very imprecise and makes it difficult to answer the question approprietely. There is a big difference between:
data={411x7cell 411x7cell 411x7cell 411x7cell 411x7cell ' '}
and
test = { {'a', 'b', 'c'}, {'d', 'e', 'f'},{''}}
The former is a cell array where some cells may be empty (the others containing cell arrays). Removing those empty cells is trivial:
data(cellfun('isempty', data)) = [];
The latter is a cell array where no cell is ever empty, all cells being themselves cell arrays. Some of these subcell arrays may be empty. Removing these empty cell arrays within cell array is a bit more complicated, since you now need to dig through two cell arrays to test for emptyness:
test(cellfun(@(c) all(cellfun('isempty', c)), test) = [];
5 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480161
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480161
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480169
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480169
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480179
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480179
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480181
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480181
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480185
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/354328-delete-empty-cells-of-data-array#comment_480185
Sign in to comment.