matlab change upper case character to lower case character in string

I would like to take a string and change the first letter of that string from upper to lower case in MATLAB. Any suggestions. Example:

a = 'Upper'; % Do something to a a = 'upper' 
thank you in advance asked Jan 15, 2014 at 16:03 413 4 4 silver badges 14 14 bronze badges

2 Answers 2

a = lower(a); 

If you only need to change the first letter to upper case, try the following:

a = [lower(a(1)) a(2:end)]; 

Check out here for more info.

answered Jan 15, 2014 at 16:17 herohuyongtao herohuyongtao 50.4k 30 30 gold badges 137 137 silver badges 176 176 bronze badges

That will convert the whole string to lower case as opposed to only the first letter, which what the OP is after. It turns out that it works just fine for his example, but consider for example UppeR : that would give you upper instead of uppeR .