Homework 4 Logicals Function Name giraffeCase Inputs 1 char
     Homework 4 Logicals Function Name: giraffeCase Inputs: 1. (char) A sentence to be converted to giraffe case outputs: 1. (char) The sentence converted to giraffe case Banned Functions: strrep() Function Description: You might have heard of camel case, the naming convention typically used when naming variables and functions in MATLAB, but have you ever heard of giraffe case? Probably not, since we just made it up! Write a function that converts a given phrase to giraffe case according to the following rules: 1. Capitalize all letters that occur at the end of a word, and make all other letters lowercase. 2. If giraffe\' appears in the string with any capitalization, capitalize all its letters GIRAFFE 3. Remove all spaces and non-letter characters. For instance, the string \'Giraffes are just long horses would be converted to GIRAFFESarEjusTlonGhorses\' Notes: Punctuation may occur anywhere in the string. \'giraffe\' will not appear in a string more than once. giraffe may be a substring of another word so if \'giraffezone occurs in the string, it should become \'GIRAFFEzonE\'. Each word will be separated by at least one space. The string will always begin with a letter.  
  
  Solution
% input string given by user
str = \'abcd Giraffe hijk lmn\';
% capitalize last letter of a word
 f = x(2:end-1), upper(x(end))];
%remove all special character
% This will covert giraffe to GIRAFFE
 out = regexprep(str, \'\\<\\w{giraffe}\\>\', \'${f($0)}\')
% abcDGIRAFFEhijKlmN

