{"id":10880,"date":"2019-07-29T12:00:30","date_gmt":"2019-07-29T16:00:30","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=10880"},"modified":"2019-07-29T11:25:56","modified_gmt":"2019-07-29T15:25:56","slug":"when-was-the-function-introduced","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2019\/07\/29\/when-was-the-function-introduced\/","title":{"rendered":"When was the function introduced?"},"content":{"rendered":"\r\n<div class=\"content\"><p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\">Jiro<\/a>&#8216;s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54483\"><tt>when<\/tt><\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2664900\">Reza Ahmadzadeh<\/a>.<\/p><p>Working at MathWorks, I have become spoiled and have become used to always having access to the newest release (actually, I have access to future releases under development). When I was an application engineer delivering seminars, I would get questions like &#8220;when did that command become available?&#8221; or &#8220;I just tried to run it on my MATLAB and I get an error&#8221;.<\/p><p>For functions introduced after R2006a, I would show the <a href=\"https:\/\/www.mathworks.com\/help\/index.html\">documentation<\/a>, as it shows when a function was introduced.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_when\/when_documentation2.png\" alt=\"\"> <\/p><p>Reza&#8217;s entry gives you this information directly at the command line.<\/p><pre class=\"codeinput\">when <span class=\"string\">filloutliers<\/span>\r\n<\/pre><pre class=\"codeoutput\">## [filloutliers] is a Matlab function or an ordinary m-file (Introduced in R2017a).\r\n<\/pre><p>Very nice idea! I have one suggestion for improvement. The code only searches for MATLAB or Simulink functions. It would be great if it can search any toolbox functions.<\/p><p><b>Comments<\/b><\/p><p>Give it a try and let us know what you think <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=10880#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54483#comment\">comment<\/a> for Reza.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_4bd432c4d19e476593d88c4e53b0c6d6() {\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='4bd432c4d19e476593d88c4e53b0c6d6 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 4bd432c4d19e476593d88c4e53b0c6d6';\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 2019 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_4bd432c4d19e476593d88c4e53b0c6d6()\"><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; R2019a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2019a<br><\/p><\/div><!--\r\n4bd432c4d19e476593d88c4e53b0c6d6 ##### SOURCE BEGIN #####\r\n%%\r\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871 Jiro>'s\r\n% Pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54483 |when|> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2664900 Reza\r\n% Ahmadzadeh>.\r\n%\r\n% Working at MathWorks, I have become spoiled and have become used to\r\n% always having access to the newest release (actually, I have access to\r\n% future releases under development). When I was an application engineer\r\n% delivering seminars, I would get questions like \"when did that command\r\n% become available?\" or \"I just tried to run it on my MATLAB and I get an\r\n% error\".\r\n%\r\n% For functions introduced after R2006a, I would show the\r\n% <https:\/\/www.mathworks.com\/help\/index.html documentation>, as it shows\r\n% when a function was introduced.\r\n%\r\n% <<when_documentation2.png>>\r\n%\r\n% Reza's entry gives you this information directly at the command line.\r\n\r\nwhen filloutliers\r\n\r\n%%\r\n% Very nice idea! I have one suggestion for improvement. The code only\r\n% searches for MATLAB or Simulink functions. It would be great if it can\r\n% search any toolbox functions.\r\n%\r\n% *Comments*\r\n%\r\n% Give it a try and let us know what you think\r\n% <http:\/\/blogs.mathworks.com\/pick\/?p=10880#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54483#comment\r\n% comment> for Reza.\r\n\r\n##### SOURCE END ##### 4bd432c4d19e476593d88c4e53b0c6d6\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_when\/when_documentation2.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\nJiro&#8216;s Pick this week is when by Reza Ahmadzadeh.Working at MathWorks, I have become spoiled and have become used to always having access to the newest release (actually, I have access to&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2019\/07\/29\/when-was-the-function-introduced\/\">read more >><\/a><\/p>","protected":false},"author":35,"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\/10880"}],"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\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=10880"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10880\/revisions"}],"predecessor-version":[{"id":10884,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10880\/revisions\/10884"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=10880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=10880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=10880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}