How can I create an acronym from a string in MATLAB?

后端 未结 2 959
旧时难觅i
旧时难觅i 2020-12-19 18:26

Is there an easy way to create an acronym from a string in MATLAB? For example:

\'Superior Temporal Gyrus\' => \'STG\'
2条回答
  •  有刺的猬
    2020-12-19 19:10

    thanks, also this:

    s1(regexp(s1, '[A-Z]', 'start'))
    

    will return abbreviation consisting of capital letters in the string. Note the string has to be in Sentence Case

提交回复
热议问题