{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
function [A B C D E F G H I J] = ABCs_strings(str1, str2, vec1, alph1, ch1, double1) % 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 are the ascii values of str1? % Store your answer in the variable A. A = double(str1); %<fix this line>% A % b) Casting to strings. Cast vec1 to a character array (string). Store % your result in a variable named B. B = char(vec1); %<fix this line>% B % c) Slicing and Concatenation. Make a new string which is the % concatenation of all of str1, then a space, and % then all of str2. Store your result in a variable named C. C = ([str1, ' ', str2]); %<fix this line>% C % d) Arithmetic Operations. alph1 is some letter of the alphabet, but it % is not the letter 'a' or 'A'. Find the letter preceding alph1. Your % answer should be in the same case as alph1. Store your result in a % variable named D. D = char(double(alph1) - 1); %<fix this line>% D % e) Logical Operations. Is the first letter of str1, which is an ascii
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern