{"id":191,"date":"2008-02-04T07:04:37","date_gmt":"2008-02-04T12:04:37","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2008\/02\/04\/exposing-your-dependencies\/"},"modified":"2008-02-04T17:08:55","modified_gmt":"2008-02-04T22:08:55","slug":"exposing-your-dependencies","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2008\/02\/04\/exposing-your-dependencies\/","title":{"rendered":"Exposing your dependencies"},"content":{"rendered":"<p>Most M-files you author probably depend on other files you&#8217;ve written, or maybe they depend on specialized toolboxes that you have installed. When you want to share your finely crafted code, you&#8217;re forced to remember or figure out which files you&#8217;ll need in order to run your main file. After you&#8217;ve figured that out, you probably zip up those files and ship them off to a colleague. If you&#8217;re like me, you&#8217;ll inevitably have forgotten a file.<\/p>\n<p>This all feels a little non-deterministic to me and I <i>really<\/i> like predictability (I know, I&#8217;m so boring!). Enter, the MATLAB <a href=\"https:\/\/www.mathworks.com\/access\/helpdesk\/help\/techdoc\/index.html?\/access\/helpdesk\/help\/techdoc\/matlab_env\/f9-6232.html&#038;https:\/\/www.mathworks.com\/access\/helpdesk\/help\/techdoc\/helptoc.html#f9-16299\"><i><b>Dependency Report<\/b><\/i><\/a>. This report will show you all the files that you&#8217;re dependent on. Though it will not show dependencies on base MATLAB, as those are considered implied (your colleagues will already have those files).<\/p>\n<p>You&#8217;re only a couple clicks away from exposing your dependencies. First, open the file you want to generate the dependencies for in the MATLAB Editor. Next, goto the <i>Tools<\/i> menu and select <i>Show Dependency Report<\/i>.<\/p>\n<div align=\"center\">\n<a  href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/tools_menu.jpg\"><br \/>\n<img decoding=\"async\" border=\"0\" align=\"center\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/tools_menu_small.jpg\"\/><br \/>\n<\/a>\n<\/div>\n<p><\/br><br \/>\nYou&#8217;ll be given an HTML report that looks something like this:<\/p>\n<div align=\"center\">\n<a  href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/dependency_report.jpg\"><br \/>\n<img decoding=\"async\" border=\"0\" align=\"center\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/dependency_report_small.jpg\"\/><br \/>\n<\/a>\n<\/div>\n<p>The above dependency report was run on the <a href=https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=2046&#038;objectType=file\">Image Processing Toolbox Utilities (IMUI)<\/a> submission on <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/\">MATLAB Central<\/a>. The report shows all of the files in the IMUI toolset that <tt>imui.m<\/tt> is dependent on, as well as the dependenciees on files in the <a href=\"https:\/\/www.mathworks.com\/products\/image\/\">Image Processing Toolbox<\/a>.<\/p>\n<p>You can also run the dependency report on an entire directory. In the <i>Current Directory Browser<\/i>, select the directory you want to run the report on, then select the drop-down arrow on the reports button (see below) and select <i>Dependency Report<\/i>.<\/p>\n<div align=\"center\">\n<a  href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/tools_menu.jpg\"><br \/>\n<img decoding=\"async\" border=\"0\" align=\"center\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_exposing_your_dependencies\/current_directory_browser.jpg\"\/><br \/>\n<\/a>\n<\/div>\n<p>Now you can be sure that you&#8217;ve included all the necessary files when you share your code &#8211; predictability at its finest!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most M-files you author probably depend on other files you&#8217;ve written, or maybe they depend on specialized toolboxes that you have installed. When you want to share your finely crafted code,&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2008\/02\/04\/exposing-your-dependencies\/\">read more >><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,9],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/191"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}