MATLAB: Set an empty cell array equal to zero.

null cell array

So I have a cell array that equals {[]} because it's empty. How can I create an empty array equal to zero using an if then statement?
My attempt:
if strcmp(stopcodon1,'[]');
stopcodon1=0;
end
It doesn't work at all.

Best Answer

Actually, the cell array itself is not empty, it holds an empty array. And, empty isn't a string value anyway so that comparison wouldn't work even if there were an equality test for empty (which there isn't). All in all, that's barking up the wrong tree entirely... :)
if isempty(stopcodon1{:})
...
should lead to nirvana. Or, of course, modify program logic to not create the cell variable if the array itself is empty (altho that may break some other symmetry in algorithms, granted).