{"id":497,"date":"2011-10-24T19:57:51","date_gmt":"2011-10-24T19:57:51","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2011\/10\/24\/function-name-case-sensitivity-in-matlab-r2011b\/"},"modified":"2011-10-24T19:57:51","modified_gmt":"2011-10-24T19:57:51","slug":"function-name-case-sensitivity-in-matlab-r2011b","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2011\/10\/24\/function-name-case-sensitivity-in-matlab-r2011b\/","title":{"rendered":"Function Name Case Sensitivity in MATLAB R2011b"},"content":{"rendered":"<p>I can barely remember a MATLAB version that did not produce an inexact case match warning if you used the wrong capitalization of a function name. Now, the days of willy-nilly capitalization in MATLAB are over. Starting in R2011b, that long-time warning is now an error. <\/p>\n<p>Here is the warning message in R2010a by calling &#8220;foo.m&#8221; with the command &#8220;<tt>Foo<\/tt>&#8220;:<\/p>\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">Warning: Could not find an exact (case-sensitive) match for 'Foo'.\r\n..\/foo.m is a case-insensitive match and will be used instead.\r\nYou can improve the performance of your code by using exact\r\nname matches and we therefore recommend that you update your\r\nusage accordingly. Alternatively, you can disable this warning using\r\nwarning('off','MATLAB:dispatcher:InexactCaseMatch').\r\nThis warning will become an error in future releases. \r\n<\/pre>\n<p>As promised, R2011b is the future release where this is now an error:<\/p>\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200); color:red\">Cannot find an exact (case-sensitive) match for 'Foo'.\r\nDo you want: foo\r\n(in ..\/foo.m)?\r\n<\/pre>\n<p>This error identifier for this message is the same as the old warning: <tt>'MATLAB:dispatcher:InexactCaseMatch'<\/tt>. If you still have any misspelled functions in your code, they should be spot by running the code and looking for these errors. Before launching your main script, run the command: <\/p>\n<p><tt>dbstop if error MATLAB:dispatcher:InexactCaseMatch<\/tt><\/p>\n<p>and your program will pause whenever this error occurs. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I can barely remember a MATLAB version that did not produce an inexact case match warning if you used the wrong capitalization of a function name. Now, the days of willy-nilly capitalization in&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2011\/10\/24\/function-name-case-sensitivity-in-matlab-r2011b\/\">read more >><\/a><\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[69],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/497"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=497"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/497\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}