Morse Code Generator! Try it! - MATLAB Cody - MATLAB Central

Problem 1696. Morse Code Generator! Try it!

Difficulty:Rate
.... . .-.. .-.. ---     . ...- . .-. -.-- --- -. . -.-.-- 
      .-.. . - ...       -.. ---       ... --- -- .       -- --- .-. ... .       -.-. --- -.. . -.-.--             .-- . .-.. .-..       - .... .. ...       -- --- .-. ... .       -.-. --- -.. .       --. . -. . .-. .- - --- .-.       ..- ... . ...       - .... .       .. -. - . .-. -. .- - .. --- -. .- .-..       ... - -.-- .-.. .       -- --- .-. ... .       -.-. --- -.. . .-.-.-             - .... .       .-.-.-       .- -. -..              -- .- -.- .       ..- .--.       .- .-.. .-..       - .... .       -.-. --- -.. . --..--       - .... . .-. .       .. ...       --- -. .       ... .--. .- -.-. .       - .... .- -       ... . .--. .- .-. .- - . ...       .-.. . - - . .-. ...       .- -. -..       .....       ... .--. .- -.-. . ...       - .... .- -       ... . .--. .- .-. .- - .       .-- --- .-. -.. ... .-.-.-             ... --- -- .       .--. ..- -. -.-. - ..- .- - .. --- -.       .. ...       ..- ... . -.. .-.-.- .-.-.- .-.-.-             --- - .... . .-.       - .... . -.       - .... .- - --..--       .- .-.. .-..       -.-- --- ..-       -. . . -..       - ---       -.. ---       .. ...       - .- -.- .       .. -.       ... --- -- .       - -.-- .--. .       --- ..-.       - . -..- -       .. -.       - .... .       ..-. --- .-. --       --- ..-.       .-       ... - .-. .. -. --.       .- -. -..       - ..- .-. -.       .. -       .. -. - ---       .-       -- --- .-. ... .       -.-. --- -.. .       .-.. .. -. .        -.-. .... .- .-.       -.-. .-.. .- ... ...  --..--       .- ...       - .... .       . -..- .- -- .--. .-.. .       -... . .-.. --- .--       ... .... --- .-- ...  
text = 'Morse code is FUN!'
Morse_code_out = '-- --- .-. ... .       -.-. --- -.. .       .. ...       ..-. ..- -. -.-.--'

Just a note: this uses international style Morse code found in:

http://en.wikipedia.org/wiki/American_Morse_code

Solution Stats

23.34% Correct | 76.66% Incorrect
Last Solution submitted on Dec 18, 2024

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers83

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page