MATLAB: Replace nan with blank

nanremove nanreplace nanreplace with blank

abc={1,[],'weak'} now i want to remove [] from above variable abc and give me abc={1,'weak'} only, can any one suggest me any method for it.

Best Answer

out = abc(~cellfun(@isempty,abc));
or
abc(cellfun(@isempty,abc)) = [];