Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

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

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio

Eche un vistazo a continuación

1 de 1 Anuncio

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

Descargar para leer sin conexión

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

Más Contenido Relacionado

Más de rtodd101 (20)

Más reciente (20)

Anuncio

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

  1. 1. 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

×