{"id":1266,"date":"2015-11-13T08:20:38","date_gmt":"2015-11-13T13:20:38","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=1266"},"modified":"2015-11-06T08:22:40","modified_gmt":"2015-11-06T13:22:40","slug":"an-old-adage-in-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2015\/11\/13\/an-old-adage-in-matlab\/","title":{"rendered":"An Old Adage in MATLAB"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>I have to admit, I enjoy puns and plays on words of almost any kind.  As I was driving to work this morning, I was thinking about the MATLAB function <tt><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/eval.html\">eval<\/a><\/tt>.  And something just clicked for me.  I am sure the person sitting in the car beside me at the light thought I was crazy.<\/p><!--\/introduction--><p>$$zip(\\$) = \\sqrt{all(e^{val})}$$<\/p><p>Of course, later I looked on the internet, and, of course, found variants dozens of times over.  Oh well.<\/p><p>To understand the equation I wrote, it may help to know some <a href=\"http:\/\/mentalfloss.com\/article\/51426\/why-does-love-mean-zero-tennis\">tennis terminology<\/a>.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/www.clker.com\/cliparts\/d\/k\/r\/Z\/J\/H\/tennis-th.png\" alt=\"\"> <\/p><p>It may also help to know some synonyms for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Names_for_the_number_0_in_English\">0<\/a> :-).<\/p><p>Of course, we, at MathWorks, might say something a bit different.  See <a href=\"http:\/\/matlab.wikia.com\/wiki\/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F\">this article<\/a>, and <a href=\"https:\/\/blogs.mathworks.com\/loren\/2010\/06\/25\/what-data-is-available\/\">this one<\/a>, for examples.  They discuss why not too \"poof\" variables into the workspace.<\/p><p>$$eval = \\sqrt[n]{bad \\ surprises}$$<\/p><p><b>Bragging rights<\/b><\/p><p>Bragging rights go to the first correct English \"translation\" from a non-native English speaker.  Post your answers <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=1266#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_b54bce83838740b6a5068f66c62943cc() {\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='b54bce83838740b6a5068f66c62943cc ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' b54bce83838740b6a5068f66c62943cc';\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        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_b54bce83838740b6a5068f66c62943cc()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><\/div><!--\r\nb54bce83838740b6a5068f66c62943cc ##### SOURCE BEGIN #####\r\n%% An Old Adage in MATLAB\r\n% I have to admit, I enjoy puns and plays on words of almost any kind.  As\r\n% I was driving to work this morning, I was thinking about the MATLAB\r\n% function\r\n% |<https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/eval.html\r\n% eval>|.  And something just clicked for me.  I am sure the person sitting\r\n% in the car beside me at the light thought I was crazy.\r\n\r\n%%\r\n% \r\n% $$zip(\\$) = \\sqrt{all(e^{val})}$$\r\n% \r\n%%\r\n% Of course, later I looked on the internet, and, of course, found variants\r\n% dozens of times over.  Oh well.\r\n%%\r\n% To understand the equation I wrote, it may help to know some\r\n% <http:\/\/mentalfloss.com\/article\/51426\/why-does-love-mean-zero-tennis\r\n% tennis terminology>.  \r\n%\r\n% \r\n% \r\n% <<http:\/\/www.clker.com\/cliparts\/d\/k\/r\/Z\/J\/H\/tennis-th.png>>\r\n% \r\n% It may also help to know some synonyms for\r\n% <https:\/\/en.wikipedia.org\/wiki\/Names_for_the_number_0_in_English 0> :-).\r\n%\r\n%%\r\n% Of course, we, at MathWorks, might say something a bit different.  See\r\n% <http:\/\/matlab.wikia.com\/wiki\/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F\r\n% this article>, and\r\n% <https:\/\/blogs.mathworks.com\/loren\/2010\/06\/25\/what-data-is-available\/ this\r\n% one>, for examples.  They discuss why not too \"poof\" variables into the\r\n% workspace.\r\n%\r\n% $$eval = \\sqrt[n]{bad \\ surprises}$$\r\n%\r\n%%\r\n% *Bragging rights*\r\n%%\r\n% Bragging rights go to the first correct English \"translation\" from a\r\n% non-native English speaker.  Post your answers\r\n% <https:\/\/blogs.mathworks.com\/loren\/?p=1266#respond here>.\r\n##### SOURCE END ##### b54bce83838740b6a5068f66c62943cc\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"http:\/\/www.clker.com\/cliparts\/d\/k\/r\/Z\/J\/H\/tennis-th.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>I have to admit, I enjoy puns and plays on words of almost any kind.  As I was driving to work this morning, I was thinking about the MATLAB function <tt><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/eval.html\">eval<\/a><\/tt>.  And something just clicked for me.  I am sure the person sitting in the car beside me at the light thought I was crazy.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2015\/11\/13\/an-old-adage-in-matlab\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,33,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1266"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=1266"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1266\/revisions"}],"predecessor-version":[{"id":1269,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1266\/revisions\/1269"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=1266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=1266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=1266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}