Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

very quickly whats 1 + 1

Answered: 1 week ago

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago