Question: Engineering computation with MATLAB 3 rd Edition Chapter 6 Problem 4 The function rot(s, n) is a simple Caesar cipher encryption algorithm that replaces each

Engineering computation with MATLAB 3rd Edition Chapter 6 Problem 4

The function rot(s, n) is a simple Caesar cipher encryption algorithm that replaces each English letter in places forward or backward along the alphabet in the strings. For example, the result of rot(Baz!,3) is Edc!. An encrypted string can be deciphered by simply performing the inverse rotation on it, i.e., rot(Edc!,3), which rotates each English letter in the strings three places to the left. Numbers, symbols, and non-letters are not transformed. Implement the following function:

function rotatedText=rot(text,n)

To assist you as you solve this problem, you could write several functions as local functions in the rot.m isUppercaseLetter(letter), getUppercaseLetter(n), getLowercaseLetter(n), and getPosition(letter). You may also wish to use the built-in MATLAB functions isletter(), find(), and mod().

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!