This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %the following position will need to be a capital letter z = y+1; a = str1(z)>='a' & str1(z)<='z'; b = z(a); str1(b) = char(str1(b)-('a'-'A')); %indexes the positions following the spaces and makes the characters %capital letters if they were lowercase 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
- Spring '08