MATLAB: Find a string element in a structure matrix

findstringsstructure

assume i have a matrix t =
'abc'
'defg'
'hi'
i want to check if 'abc' is in the matrix t
however this code doesnt seem to work
if (find(t == 'abc') >0)
i get the following error message Undefined function or method 'eq' for input arguments of type 'cell'.

Best Answer

The shown data cannot be a matrix, because a matrix must have a rectangular shape. I assume you mean a cell string:
C = {'abc', 'defg', 'hi'};
Then:
if any(strcmp(C, 'abc'))
disp('abc found');
end