Question: this is in Matlab Problem 3 Write a program that prompts the user for a string of unspecified length made up of characters and then

 this is in Matlab Problem 3 Write a program that prompts

this is in Matlab

Problem 3 Write a program that prompts the user for a string of unspecified length made up of characters and then translates this string into a sequence of binary digits. You will do this by translating each character of the input string into a vector of five binary digits and then appending these vectors successively to one long vector that represents the whole message (hint: one way to do this is by building your output vector of binary digits using a switch statement nested within a for loop). You may assume valid user input. Use the following key for your translations: Character 1 "A" or "a" "B" or "b "C" or "c" "D" or "d" "E" or "e "F" or "F" "Gorg "H" or "h" "" or "j" "J" or " "K" or "k Lory "M" or "m" "N" or "n" "O" or "o "P" or "p" Code 00000 00001 100010 100011 | 00100 100 101 00110 1 00111 01000 01001 101010 | 01011 01100 | 01101 01110 01111 Character 10" or " "R" or " "S" or " "Tor " | 'U' or 'u" | "V" or "v" W or w X" or " "Y" or "y" 1 Zorz NRRERERGER Code 10000 10001 10010 10011 101001 101011 10110 10111 11000 11001 11010 11011 11100 | 11101 11110 | 11111 Example of how program works: Prompt user for input User inputs: 'HelloWorld! Create a string vector for binary output (output = '';) Start loop Determine first character (H) Set binary output vector to '00111' (output = strcat(output,'00111'):) Restart loop Determine second character "e", same result as "E") Append '00100' to the end of the output vector (output = strcat (output,'00100):) End loop after all characters are read Display the output vector of binary digits

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!