MATLAB: Finding occurences of a string in a text string and storing locations of the occurences

text strings

How do I find all occurrences of the string @3G in string TS1 and place the locations of the first character of each such substring (@) into Str3G. Example: TS1='%@3Gb6kl@3G9@33G' returns Str3G=[2 9].

Best Answer

strfind()