Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am having trouble with this question, please help me understand and complete t

ID: 666289 • Letter: I

Question

I am having trouble with this question, please help me understand and complete the question.

Write a Matlab program that converts a string (text) message up to 140 characters long into an encrypted message, and then decrypts the message to return the same string.

The code should be capable of taking a message of any length up to 140 characters, convert the message from letters to numbers, use matrix manipulation described below to encode the numerical message, then decode the numerical message and convert the decoded message back to its original string.

Your code must be capable to use all 26 English alphabet characters, a space, and numbers 0-9. You may assume that all characters are lower case. Capitalization, punctuation or special characters are encouraged, but not required. Your encoded message is not required to contain all of the letters and numbers.

You must use a simple substitution of a=1, b=2, … z=26, space=27, 1=28, …. 0=37. No other string to number substitution will be allowed for this project. If you use additional characters, use numerical values starting with 38.

You must use at least one loop that converts letters to numeric values. No other method, shortcut, or built in matlab command will be accepted.

You may input the message into your program by assigning its value as a variable in the program. (input statements are not required or preferred for the submitted code).

The program must be capable of converting any message, not just one that you hard code into it.

The command window should display only the initial text, the encrypted message, and the decoded message. Other internal computation results and variables should not appear in the command window. Only the desired output should appear.

Hint: Follow this set of steps:

Create pseudo-code for the program

Display the message string

Convert the string message to the numerical equivalent in a vector. Using at least one loop

Reshape the vector into a message matrix 10 x 14 using reshape command

Create an encoding matrix (Note that it must have the same number of columns as the message matrix has rows, and must be invertible)

Multiply the encoding matrix by the converted string matrix to create the encoded message

Display the encoded message. This is the message that would be transmitted.

Create a decoding matrix by inverting the encoding matrix

Multiply the encoded matrix by the decoding matrix.

Change the numbers back to string values and display the string message

Display the decoded message.  

Thanks so much for the help!

Explanation / Answer

reshape(input_data,ofdm_length,nloops);

Syntax

Description

B = reshape(A,sz) reshapes A using the size vector, sz, to define size(B). For example, reshape(A,[2,3]) reshapes A into a 2-by-3 matrix. sz must contain at least 2 elements, and prod(sz) must be the same as numel(A).

B = reshape(A,sz1,...,szN) reshapes A into a sz1-by-...-by-szN array where sz1,...,szN indicates the size of each dimension. You can specify a single dimension size of [] to have the dimension size automatically calculated, such that the number of elements in B matches the number of elements in A. For example, if A is a 10-by-10 matrix, then reshape(A,2,2,[]) reshapes the 100 elements of A into a 2-by-2-by-25 array.