{"id":158,"date":"2007-11-26T10:01:28","date_gmt":"2007-11-26T15:01:28","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2007\/11\/26\/giving-your-code-some-privacy\/"},"modified":"2007-11-26T12:27:58","modified_gmt":"2007-11-26T17:27:58","slug":"giving-your-code-some-privacy","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2007\/11\/26\/giving-your-code-some-privacy\/","title":{"rendered":"Giving your code some privacy"},"content":{"rendered":"<p>In R2007b, code folding was introduced in the Editor for functions and help comments.  I find this particularly useful for large M-files like edit.m, which have a lot of subfunctions.  By collapsing all the folds in the file, I can quickly skim through the helper subfunctions.<\/p>\n<p style=\"text-align: center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/foldededit.PNG\" title=\"foldededit.PNG\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/foldededit.PNG\" alt=\"foldededit.PNG\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/foldededit.PNG\" title=\"foldededit.PNG\"><\/a>The Editor remembers which folds I had collapsed in each file, even between sessions of MATLAB, and I can choose to disable code folding if I wish from the preference panel:<\/p>\n<p style=\"text-align: center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/codefoldingprefs.PNG\" title=\"codefoldingprefs.PNG\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/codefoldingprefs.PNG\" alt=\"codefoldingprefs.PNG\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/codefoldingprefs.PNG\" title=\"codefoldingprefs.PNG\"><\/a>At this point, I know what all of you are saying&#8211; &#8220;Why does this only work for functions?  I want to be able to fold all my MATLAB keywords!&#8221;.  Don&#8217;t worry, I&#8217;ve already heard you, and that will be in a future release.  In the meantime, try out our first version of code folding and let us know what you think!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In R2007b, code folding was introduced in the Editor for functions and help comments.  I find this particularly useful for large M-files like edit.m, which have a lot of subfunctions.  By collapsing&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2007\/11\/26\/giving-your-code-some-privacy\/\">read more >><\/a><\/p>\n","protected":false},"author":49,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/158"}],"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\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/158\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}