{"id":2325,"date":"2008-09-19T07:24:41","date_gmt":"2008-09-19T12:24:41","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/19\/de-do-do-do-de-dah-dah-dah\/"},"modified":"2016-05-17T14:55:37","modified_gmt":"2016-05-17T18:55:37","slug":"de-do-do-do-de-dah-dah-dah","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/19\/de-do-do-do-de-dah-dah-dah\/","title":{"rendered":"De do do do, de dah dah dah&#8230;"},"content":{"rendered":"<div class=\"content\">\r\n\r\nBrett's Pick this week is <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=7791&amp;objectType=file (link no longer works)\">Morse<\/a>, by Fahad Al Mahmood.\r\n\r\nLast week I blogged about <a href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/12\/making-matlab-talk\/\">how to make MATLAB talk<\/a>. This week, we can look at how to make it speak <a href=\"http:\/\/en.wikipedia.org\/wiki\/Morse_code\">Morse code<\/a>!\r\n\r\nI recall fondly being an undergrad engineering student, and being required to learn Morse code as a prerequisite to throwing\r\nmy name into contention to drive a solar-powered car in a long-distance race. I never got very good at it (Morse code, that\r\nis), and have forgotten everything I once knew. (Except for S's and O's...we all seem to know them!)\r\n\r\nFahad's MORSE is pretty cool; it renders a string of characters as an audible series of dots and dashes, making translating\r\nwords into Morse code trivially easy. Now if someone would just write a MATLAB program that listens to a series of dots and\r\ndashes and translates it back to text. Any takers?\r\n\r\n<embed src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Brett\/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CbaseURL%3A%27http%3A%2F%2Fblogs%2Emathworks%2Ecom%2Fimages%2Fpick%2FBrett%27%2CsplashImageFile%3A%27MorseThinkingML%2Ejpg%27%2CvideoFile%3A%27MorseCode%2Eflv%27%2Cloop%3Afalse%2CinitialScale%3A%27fit%27%2CshowFullScreenButton%3Afalse%2CautoBuffering%3Afalse%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%5D%2CautoPlay%3Afalse%7D\" type=\"application\/x-shockwave-flash\" width=\"500\" height=\"400\"><\/embed>\r\n\r\nOh, and there's a t-shirt in it for the first person to post in the comments to this blog the (exact!) message encoded in\r\nthe video above!\r\n\r\n<script>\/\/ <![CDATA[\r\nfunction grabCode_18d29a671d6f436587ce7a648fe1d615() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='18d29a671d6f436587ce7a648fe1d615 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 18d29a671d6f436587ce7a648fe1d615';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2008 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('\r\n\r\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\r\n\r\n\r\n\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }\r\n\/\/ ]]><\/script>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\">\r\n<a><span style=\"font-size: x-small; font-style: italic;\">Get\r\nthe MATLAB code\r\n<noscript>(requires JavaScript)<\/noscript><\/span><\/a>\r\n\r\nPublished with MATLAB\u00ae 7.6<\/p>\r\n\r\n<\/div>\r\n<!--\r\n18d29a671d6f436587ce7a648fe1d615 ##### SOURCE BEGIN #####\r\n%% Morse Code from MATLAB\r\n%%\r\n% <Brett>'s Pick this week is <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=7791&objectType=file Morse>, by <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadAuthor.do?objectType=author&objectId=1093883 Fahad Al Mahmood>.\r\n%%\r\n%%\r\n% Last week I blogged about <https:\/\/blogs.mathworks.com\/pick\/2008\/09\/12\/making-matlab-talk\/ how to make MATLAB talk>. This week, we can look at how to make it speak <http:\/\/en.wikipedia.org\/wiki\/Morse_code Morse code>!\r\n\r\n%%\r\n% I recall fondly being an undergrad engineering student, and being required to learn Morse code as a prerequisite to throwing my name into contention to drive a solar-powered car in a long-distance race. I never got very good at it (Morse code, that is), and have forgotten everything I once knew. (Except for S's and O's...we all seem to know them!)\r\n\r\n%%\r\n% Fahad's MORSE is pretty cool; it renders a string of characters as an audible series of dots and dashes, making translating words into Morse code trivially easy. Now if someone would just write a MATLAB program that listens to a series of dots and dashes and translates it back to text. Any takers?\r\n\r\n%%\r\n% Oh, and there's a t-shirt in it for the first person to post in the comments to this blog the (exact!) message encoded in the video above!\r\n##### SOURCE END ##### 18d29a671d6f436587ce7a648fe1d615\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n\r\nBrett's Pick this week is Morse, by Fahad Al Mahmood.\r\n\r\nLast week I blogged about how to make MATLAB talk. This week, we can look at how to make it speak Morse code!\r\n\r\nI recall fondly being an... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/19\/de-do-do-do-de-dah-dah-dah\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2325"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2325"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2325\/revisions"}],"predecessor-version":[{"id":7216,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2325\/revisions\/7216"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}