Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Matlab Your Approach in Matlab: Work only with capital letters and ignore spaces. The above message would be THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG. If you know modular arithmetic

Use Matlabimage text in transcribed

Your Approach in Matlab:

  • Work only with capital letters and ignore spaces. The above message would be
    THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.
  • If you know modular arithmetic you may want to use it, but not all of your peers have seen it. Therefore, do not use modular arithmetic in this project.
  • I recommend using the rem command.
  • In MATLAB, it's easier to work with numbers than with strings. Here is a set-up that will allow you to convert between letters and numbers:
    • (Numbers to letters) Define a vector
      alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
      What happens if you execute the following commands?
      alphabet(1) alphabet(26) alphabet(1:26) alphabet(ones(4))
    • (Letters to numbers) You can convert letters into numbers by using the double command. Once you have defined the above vector alphabet, try double(alphabet). You will notice that you need to make an adjustment to the resulting values.
  • Practice problem: after you have done the above, try
    alphabet([13 1 20 12 1 2]).
  • Can you convert the string
    RALEIGH
    into the vector
    [18 1 12 5 9 7 8]?
    (Remark: strings need to be inside single parentheses.)

Goal:

You will write a function m file that can encode or decode messages according to the users wishes. Your function must be similar (in functionality) to the demonstration below. Note that when decoding messages, your code is not required to identify the exact message but rather provide all possible decodings.

(As there are only 25 possible shifts, we will allow ourselves to use our own deductive abilities.)

Introduction: A Caesar cipher is a basic encryption technique that shifts every letter in the alphabet by a set amount. For example, a Caesar cipher with a shift of 5 would define the following function on the alphabet: A B C D E F G H I J K L M N O P Q R S 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 F G H I J K L M N O P Q R S T U V W X Therefore, the phrase THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG would be encoded by YMJVZNHPGWTBSKTCOZRUXTAJWYMJQFEDITL. T 1 Y U 1 Z V 1 A W 1 B X 1 C Y 1 D Z 1 E Introduction: A Caesar cipher is a basic encryption technique that shifts every letter in the alphabet by a set amount. For example, a Caesar cipher with a shift of 5 would define the following function on the alphabet: A B C D E F G H I J K L M N O P Q R S 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 F G H I J K L M N O P Q R S T U V W X Therefore, the phrase THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG would be encoded by YMJVZNHPGWTBSKTCOZRUXTAJWYMJQFEDITL. T 1 Y U 1 Z V 1 A W 1 B X 1 C Y 1 D Z 1 E

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions