For arithmetic values, both solutions mentioned will work. For rows or arrays of cells, use strcmp / strcmpi .
In the help file:
TF = strcmp (C1, C2) compares each element of C1 with the same element in C2, where C1 and C2 are arrays of cells of equal row size. Input C1 or C2 can also be an array of characters with the correct number of lines. The function returns TF, a logical array that is the same size as C1 and C2, and contains logical 1 (true) for those elements C1 and C2 that are a match, and logical 0 (false) for those elements that are not do.
Example (also from the help file):
Example 2
Create 3 cells of row arrays:
A = {'MATLAB','SIMULINK';'Toolboxes','The MathWorks'}; B = {'Handle Graphics','Real Time Workshop';'Toolboxes','The MathWorks'}; C = {'handle graphics','Signal Processing';' Toolboxes', 'The MATHWORKS'};
Compare cells of arrays A and B with case sensitivity:
strcmp(A, B) ans = 0 0 1 1
Compare cells of arrays B and C without case sensitivity. Note that the "Toolboxes" do not match due to leading space characters in C {2,1} that do not appear in B {2,1}:
strcmpi(B, C) ans = 1 0 0 1
To get a single return value, not an array of booleans, use the all function, as Jonas explained.