Unformatted text preview: %he original string %Adams, Christopher Lee (Feb 11, 2010 9:23 PM EST) Krista, yes you do. .. %need to account for it. The easiest way is to assign a vector that. .. %uses the same values as the one that let you find which letters to. .. %change, then exclude the elements whose double values are not. .. %within the range of lower case letters. str1(z) = char(str1(z) - ('a' - 'A')); s %indexes the positions following the spaces and makes the characters %capital letters if they were letters in the first place % if (str1(1)>='a' & str1(1)<='z') str1(1) = char(str1(1) - ('a' - 'A')); end %the if statement is used to capitalize the first letter of the string, if %it is a char not a double, and makes it a capital letter, since it is not %preceded by a space str_out = str1; end...
View Full Document
This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.
- Spring '08