MATLAB: How to make a string == one string in a cell array

botcellscript

I need to make a chatbot for an assignment and im having trouble with this part of the script
x = input('+ ', 's');
if x == {'hey','hi','hello'};
disp('Hello')
So if the user says hi, hey or hello, the script will print hello.
But when I type in, for example, 'hey' I get the error
Undefined function 'eq' for input arguments of type 'cell'.
Error in Bot (line 3) if x == {'hey','hi'};
Cheers

Best Answer

x = input('+ ', 's');
s={'hey','hi','hello'};
if ismember(x,s)
disp('Hello')
end