Some examples would clarify the question, but it sounds like you want the INDEXC() function. flag = indexc(upcase(x),'ABC'); Then FLAG will have the position where A,B or C first appear in X. You could treat FLAG as a true/false variable if you want. Or you could convert it to a 0/1 variable by using: flag = 0 ^= indexc(upcase(x),'ABC'); or flag = not not indexc(upcase(x),'ABC');
... View more