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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

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

This note was uploaded on 07/06/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online