function ans = firstLetters(str) % find the first letters in this string fl = [true str == ' ']; ans = str(fl);