The ability to process empty cells directly with the UNIQUE function is not available in MATLAB 7.9 (R2009b).
As a workaround, you can identify which cells are not empty with the CELLFUN function:
c = {'hello', 'world', [], 'hello', 'MATLAB'}
~cellfun(@isempty, c)
Then use this logical array to index into the original cell array in order to call UNIQUE on only the elements of the cell array which are not empty:
unique(c(~cellfun(@isempty, c)))
Best Answer