{"id":3188,"date":"2014-02-12T22:45:27","date_gmt":"2014-02-13T03:45:27","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/?p=3188"},"modified":"2014-02-12T23:00:43","modified_gmt":"2014-02-13T04:00:43","slug":"everyone-loves-a-package-especially-a-hyperloop-simulation","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2014\/02\/12\/everyone-loves-a-package-especially-a-hyperloop-simulation\/","title":{"rendered":"Everyone loves a package&#8230; Especially a Hyperloop simulation."},"content":{"rendered":"<!--introduction-->\r\n<p>In case you forgot, tomorrow is <a href=\"http:\/\/en.wikipedia.org\/wiki\/Valentine's_Day\">Valentine's Day<\/a>. Instead of going for the classic bouquet of flowers or box of chocolates, why not be original and give something that will last forever... a well packaged Simulink Project.<\/p>\r\n<!--\/introduction-->\r\n\r\n<p>Because he loves all of you, Matt Brauer released his <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/44878-hyperloop-model--systems-architecture-\">Simulink model of the Hyperloop<\/a> on the MATLAB Central File Exchange.\r\n\r\n<p>Let's see how Matt used the <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/ug\/archive-projects-in-zip-files.html\">Archive capability<\/a> of Simulink Projects to package the model and its dependent files... and ended up with a nicely packaged Simulink Project!<\/p>\r\n\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q3\/mbrauer_tn_large.jpg\" alt=\"Matt Brauer, guest blogger and Hyperloop enthousiast\"><\/p>\r\n\r\n<p><strong>Packaging a Simulink Project<\/strong><\/p>\r\n\r\n<p>I\u2019ve often run into problems when sending Simulink models to colleagues. With all the scripts, functions and libraries, it\u2019s hard to keep track of all the file dependencies. I could zip up my complete working folder with standard tools. But, there are quite a few files in process or archived that I don\u2019t necessarily want to share. I could try to remove all those files, but, I might remove something that I actually need. Luckily, there are features within <a title=\"https:\/\/www.mathworks.com\/discovery\/simulink-projects.html (link no longer works)\">Simulink Projects<\/a> that can help.<\/p>\r\n\r\n<p><strong>Don\u2019t over-share<\/strong><\/p>\r\n\r\n<p>Simulink Projects differentiates between files that are within your working directory and those that are considered part of the project. You can see below how the <em>All Files<\/em> view differs from the <em>Project Files<\/em> view for my hyperloop work. Zipping up the complete folder would definitely include more than I want to share. On the other hand, an Archive will only include the Project Files.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/compare_project_files.png\" alt=\"Files in my folder, vs files in my project\" \/><br>\r\n<em>All Files within my Hyperloop folder (on left) and the Project Files associated with my Hyperloop project (on right)<\/em><\/p>\r\n\r\n<p><strong>Don\u2019t forget anything<\/strong><\/p>\r\n\r\n<p>I use the <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/dependency-analysis.html\">Dependency Analysis<\/a> to see how my Project Files are related. Here\u2019s a graphical view of the dependencies. Notice how the types of files and relationships (Reference Type) are shown. Even model callbacks, which can be hard to find manually, are identified.<\/p>\r\n\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/2_DependencyAnalysis.PNG\" alt=\"Dependency Analysis\" \/><br>\r\n<em>Impact view of the Dependency Analysis<\/em><\/p>\r\n\r\n<p>This analysis will highlight if any dependent files are missing from the project. Oops, looks like I forgot to add an enumeration definition.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/3_ProblemFiles.PNG\" alt=\"Impact view of the Dependency Analysis showing a file not included in the project.\" \/><br>\r\n<em>Impact view of the Dependency Analysis showing a file not included in the project.<\/em><\/p>\r\n\r\n<p><strong>Tying the Ribbon<\/strong><\/p>\r\n\r\n<p>When you\u2019re confident that the project is just right, packaging it into an archive is simple. Just click the Archive button (that looks like a package) in the Simulink Project pane and select a name and location for the zipped archive file. Now the project is ready for distribution.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/4_ArchiveButton.png\" alt=\"Archive\" \/><\/p>\r\n\r\n<p><strong>Opening the Package<\/strong><\/p>\r\n\r\n<p>When the recipient wants to run the model, they just need to select New > Simulink Project > From Archive and select the file and destination directory. Imagine the smiles on their faces!<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/5_NewFromArchive.png\" alt=\"Opening the Package\" \/><\/p>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>What do you think of Matt's <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/44878-hyperloop-model--systems-architecture-\">gift<\/a>? Are you interested to contribute?<\/p>\r\n\r\n<p>How do you distribute Simulink models with many dependencies? What problems do you run into?<\/p>\r\n\r\n<p>Let us know by leaving a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=3188&#comment\">comment here<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/5_NewFromArchive.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction-->\r\n<p>In case you forgot, tomorrow is <a href=\"http:\/\/en.wikipedia.org\/wiki\/Valentine's_Day\">Valentine's Day<\/a>. Instead of going for the classic bouquet of flowers or box of chocolates, why not be original and give something that will last forever... a well packaged Simulink Project.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2014\/02\/12\/everyone-loves-a-package-especially-a-hyperloop-simulation\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[34,65,24],"tags":[348,217],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3188"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=3188"}],"version-history":[{"count":27,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3188\/revisions"}],"predecessor-version":[{"id":3314,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3188\/revisions\/3314"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=3188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=3188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=3188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}