MATLAB: Capitalize only the first letter of a character capitalcharacterletterupper How to Capitalize only the first letter of a character ? upper function capitalize all the letters. I want only to make this change ONLY for the first letter. Thank you in advance Best Answer Likely a better way.a='my name';a(1)=upper(a(1)); Related SolutionsMATLAB: Function to capitalize first letter in each word in string but forces all other letters to be lowercase str='this is a tEST';str=lower(str)idx=regexp([' ' str],'(?<=\s+)\S','start')-1str(idx)=upper(str(idx)) MATLAB: How to write a program, and shuffles only the inner letter of the word Try this:word = 'abcdefgh'middleIndexes = randperm(length(word)-2) + 1newWord = [word(1), word(middleIndexes), word(end)] Related QuestionCapitalizing every word in a stringWord frequencyRegexprep() skip first occurrenceMatlab style: should table names be capitalized
Best Answer