If you want to put each capital letter in the abbreviation ...
... you can use the REGEXP function :
str = 'Superior Temporal Gyrus'; %# Sample string
abbr = str(regexp(str,'[A-Z]')); %# Get all capital letters
... or you can use the UPPER and ISSPACE functions :
abbr = str((str == upper(str)) & ~isspace(str)); %
%
%
%
... or instead, you can use ASCII / UNICODE values for capital letters:
abbr = str((str <= 90) & (str >= 65)); %
If you want to put every letter that starts the word in the abbreviation ...
... you can use the REGEXP function :
abbr = str(regexp(str,'\w+')); %
... STRTRIM, FIND ISSPACE:
str = strtrim(str); %
abbr = str([1 find(isspace(str))+1]); %
%
... , , FIND:
str = strtrim(str); %# Still have to trim whitespace
abbr = str([true isspace(str)]);
, ...
... REGEXP:
abbr = str(regexp(str,'\<[A-Z]\w*'));