MATLAB: How to index a cell vector of strings

cell index

I have a vector of cells, each one is 'x' or 'y'. How can I index them, similar to the "find" function? Thank you.

Best Answer

s={'a','b','x','c','d','x'}
idx=find(ismember(s,'x'))