{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ABCs_strings

# ABCs_strings - function[A B C D E F G H I J =...

This preview shows pages 1–2. Sign up to view the full content.

Sheet1 Page 1 function [A B C D E F G H I J] = ABCs_strings(ch1, str1, str2, str3, vec1, alph1, x, num1) % PROBLEM 2. The ABCs of Strings % % This is a multi-part problem. Do each of the parts below. % % DO NOT CHANGE THE FUNCTION HEADER (the first line of code) % a) ASCII Values & Character Mapping. What is the ascii value of ch1? % Store your answer in the variable A. A = uint8(ch1) % b) Casting to numbers. Cast str1 to a vector of class/type double. Store % your result in a variable named B. B = double(str1) % c) Casting to strings. Cast vec1 to a character array (string). Store % your result in a variable named C. C = char(vec1) % d) Slicing and Concatenation. Make a new string which is the % concatenation of the first three characters of str1, then a space, and % then all of str2. Store your result in a variable named D. D = [str1(1:1:3), ' ', str2] % e) Arithmetic Operations. alph1 is some letter of the alphabet, but it % is not the letter 'z' or 'Z'. Find the next letter after alph1. Your % answer should be in the same case as alph1.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern