Se está descargando tu SlideShare. ×

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Cargando en…3
×

1 de 1 Anuncio

# IN MATLAB- In this exercise- we will work with two string related func.docx

IN MATLAB:
In this exercise, we will work with two string related functions lower and upper. Use the help command to learn the basic usage of the two functions. Then develop a script to convert an input word to a specific format. For example, if the user entered \'oâ€™conner\', \'OCONNOR\', or \'oconner\', the script will generate \'OConnor\' for all those input words. Focus on applying the two functions and array element access to form the statements.
Solution
stringToConvert = input(\'Please enter string to covert to special format: \', \'s\');
outputString = [upper(stringToConvert(1:2)) lower(stringToConvert(3:end))];
display(outputString);
OUTPUT:
Please enter string to covert to special format: sameer
outputString = SAmeer
.

IN MATLAB:
In this exercise, we will work with two string related functions lower and upper. Use the help command to learn the basic usage of the two functions. Then develop a script to convert an input word to a specific format. For example, if the user entered \'oâ€™conner\', \'OCONNOR\', or \'oconner\', the script will generate \'OConnor\' for all those input words. Focus on applying the two functions and array element access to form the statements.
Solution
stringToConvert = input(\'Please enter string to covert to special format: \', \'s\');
outputString = [upper(stringToConvert(1:2)) lower(stringToConvert(3:end))];
display(outputString);
OUTPUT:
Please enter string to covert to special format: sameer
outputString = SAmeer
.

Anuncio
Anuncio