Question: Function Name FoodPrep() Function Description: Given a character vector containing a message, follow these steps in the correct order to decipher it: 1. Starting with

Function Name FoodPrep()

Function Description:

Given a character vector containing a message, follow these steps in the correct order

to decipher it:

1. Starting with the first index of the char vector, shift every third index up 2 ASCII

values (for example, 'q' 's' )

2. Replace all underscores '_' with a single space

3. Capitalize the first letter of every word in the sentence

Example:

mixed = 'qalr_tfe_uatcr_`efmre]boglilg_gt'

fixed = FoodPrep(mixed)

fixed 'Salt The Water Before Boiling It'

Notes:

Make sure to capitalize the first letter of every word, including the first word (step 3)

Words will be separated by a single underscore

The original statement may contain special characters, but shifting should remove all

special characters (except underscores), and the final output should not contain any

Hints:

You may need to cast the char vector to a different data type to perform a

mathematical "shift" for step 1

Homework 03 - Vectors

The letters at the beginning of a word are always one index after a space except for the

very first character of the string

The colon operator may be useful

Please Solve using matlab. to receive a thumbs up do not use conditional statements or iterations(aka loops)!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!