%% Compare Cell Arrays While Ignoring Case
% Create two cell arrays of character vectors. To compare them while ignoring case, use the strcmpi function.

s1 = {'Tinker', 'Tailor';
      '  Soldier', 'Spy'};
s2 = {'Tinker', 'Baker';
      'Soldier', 'SPY'};

tf = strcmpi(s1,s2)

% tf(1,1) is 1 because 'Tinker' is in the first cell of both arrays. tf(2,2) is 1 because 'Spy' and 'SPY' differ only in case. tf(2,1) is 0 because ' Soldier' in s1(2,1) has whitespace characters, and 'Soldier' in s2(2,1) does not.
% Copyright 2012 The MathWorks, Inc.