MATLAB: What are the differences between [] and ” in a cell array, how to identify and differentiate them

cell array

c1={'a',[],'b'}–>
isempty(c1(2))=0; Not empty
size(c(2))=1 1;
strcmp(c(2),[])=0; Not a string
c2={'a','','b'}–>
isempty(c2(2))=0; Not empty
size(c(2))=1 1;
strcmp(c(2),'')=1; Is a string
So I can use strcmp(c,'')==1 to find ''. But how about []?
Thanks…

Best Answer

isempty(c1{2})
Notice the {} instead of ()