MATLAB: How to delete a substring within a string

empty stringMATLABstrings

I have a string like this
a={ {'a', 'b', 'c','d'},{''}, {'e', 'f', 'g', 'h'},{''} }
where the two '' are empty {1×1 cell} substrings within the string. How do I delete empty substring like this and end up with
a={ {'a', 'b', 'c','d'}, {'e', 'f', 'g', 'h'} }

Best Answer

Assuming the cells to be deleted are all of the form {''}, you could simply use the isequal function. E.g.
x = cellfun(@(y)isequal(y,{''}),a);
a(x) = [];
If there could be other forms of elements that you would consider "empty", you would need to tell us what that could be.