{"id":381,"date":"2010-06-21T15:08:40","date_gmt":"2010-06-21T15:08:40","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2010\/06\/21\/why-the-help-report-no-longer-lists-subfunctions\/"},"modified":"2010-06-21T15:08:40","modified_gmt":"2010-06-21T15:08:40","slug":"why-the-help-report-no-longer-lists-subfunctions","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2010\/06\/21\/why-the-help-report-no-longer-lists-subfunctions\/","title":{"rendered":"Why the Help Report No Longer Lists Subfunctions"},"content":{"rendered":"<p>Over the past few releases we have been working to eliminate code in the desktop that duplicates or approximates the logic in the MATLAB language. The goal of this project is to reduce bugs and to make sure there is a single &#8220;truth&#8221; in regards to what we tell you about your code. Older versions of the Help Report relied on performing expression searches to identify various parts of a file&#8217;s help. As of MATLAB R2010a, the Help Report now uses the same internal APIs as the MATLAB <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010a\/techdoc\/ref\/help.html\"><tt>help<\/tt><\/a> function to extract help information from the files in a directory. This means that the report accurately reflects what you would see when typing &#8220;<tt>help <em>functionname<\/em><\/tt>&#8221; or &#8220;<tt>doc <em>functionname<\/em><\/tt>&#8220;.<\/p>\n<p>Changing the logic had an interesting consequence: the Help Report no longer lists subfunctions. Here is an example from MATLAB R2009b:<\/p>\n<div align=\"center\"><strong>Help Report R2009b<\/strong><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_help_report\/subfun_9b.png\" alt=\"Help report with subfunction in MATLAB R2009b\">\n<\/div>\n<p>compare that to MATLAB R2010a:<\/p>\n<div align=\"center\"><strong>Help Report R2010a<\/strong><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_help_report\/subfun_10a.png\" alt=\"Help report without subfunctions in MATLAB R2010a\">\n<\/div>\n<p>The reason for this change is that help system does not recognize subfunctions because they are not visible outside the parent function. In a sense, there is no valid <em>help<\/em> for them since formal help is meant for users of your public API. In fact, many of the functions that we supply that are not meant to be used by customers, and do not have help, even if they are well commented. Nonetheless, it is a good practice to comment and document the subfunctions in a file; the lack of language support for subfunction help should not be used as an excuse for lack of documentation. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the past few releases we have been working to eliminate code in the desktop that duplicates or approximates the logic in the MATLAB language. The goal of this project is to reduce bugs and to&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2010\/06\/21\/why-the-help-report-no-longer-lists-subfunctions\/\">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":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/381"}],"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=381"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/381\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}