Problem 394. Convert String to Morse Code
Solution Stats
Problem Comments
-
1 Comment
Tran Tran
on 19 Jul 2022
replace table for who need
symbol = {'A' 'N' 'B' 'O' 'C' 'P' 'D' 'Q' 'E' 'R' 'F' 'S' 'G' 'T' 'H' 'U' 'I' 'V' 'J' 'W' 'K' 'X' 'L' 'Y' 'M' 'Z' '1' '6' '2' '7' '3' '8' '4' '9' '5' '0' };
morse = {'.-' '-.' '-...' '---' '-.-.' '.--.' '-..' '--.-' '.' '.-.' '..-.' '...' '--.' '-' '....' '..-' '..' '...-' '.---' '.--' '-.-' '-..-' '.-..' '-.--' '--' '--..' '.----' '-....' '..---' '--...' '...--' '---..' '....-' '----.' '.....' '-----' };
symbol{k} ---> morse{k}
Problem Recent Solvers196
Suggested Problems
-
Remove any row in which a NaN appears
7940 Solvers
-
Back to basics 12 - Input Arguments
571 Solvers
-
153 Solvers
-
463 Solvers
-
Sum the numbers on the main diagonal
536 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!