MATLAB: Is there unknown error in strcmp

cell arraystringstrings

Hi,
I tried to use strcmp between a string and a cell array. Instead of getting '1', I keep getting '0'. May I know where I go wrong?
Example:
D=[[28];[28];[28]…[0];[0]]
Command Window
>>strcmp('[28]',D(2));
ans = 0

Best Answer

D={[28];[28];[28];[0];[0]};
strcmp('[28]',['[',num2str(D{2}),']'])
or
isequal({28},D(2))
or
28 == D{2}
or
abs(28 - D{2}) < eps(100)