{"id":2478,"date":"2017-11-28T11:31:24","date_gmt":"2017-11-28T16:31:24","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=2478"},"modified":"2017-11-28T11:31:24","modified_gmt":"2017-11-28T16:31:24","slug":"tips-for-deploying-your-work","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2017\/11\/28\/tips-for-deploying-your-work\/","title":{"rendered":"Tips for Deploying your Work"},"content":{"rendered":"\r\n<div class=\"content\"><!--introduction--><p>There are a lot of ways of sharing your ideas with MATLAB these days. Including<\/p><div><ul><li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/create-scripts.html\">MATLAB scripts<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/functions.html\">functions<\/a><\/li><li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/create-live-scripts.html\">Live scripts<\/a><\/li><li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/workspace.html\">MAT-files<\/a><\/li><li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/creating_guis\/apps-overview.html\">Apps<\/a><\/li><li>Code generation of various kinds, e.g., <a href=\"https:\/\/www.mathworks.com\/help\/coder\/index.html\">C\/C++<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/gpucoder\/index.html\">GPU<\/a> via Coder products<\/li><li><a href=\"https:\/\/www.mathworks.com\/help\/compiler\/matlab-compiler.html\">MATLAB Compiler<\/a>  and <a href=\"https:\/\/www.mathworks.com\/help\/compiler_sdk\/index.html\">SDK<\/a> (stand-alone apps and code suitable for integrating into other environments)<\/li><li><a href=\"https:\/\/www.mathworks.com\/help\/mps\/index.html\">MATLAB Production Server<\/a><\/li><\/ul><\/div><p>Today I want to remind you of some tools in MATLAB that can facilitate the transition to code you want to deploy via the MATLAB Compiler and SDK.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#fbc22a64-4bdc-4974-8e5c-55681c6bc896\">Useful Functions for Deployment<\/a><\/li><li><a href=\"#45552d61-ccba-4080-86bd-a0778b75eb37\">Other Helpful Functions?<\/a><\/li><\/ul><\/div><h4>Useful Functions for Deployment<a name=\"fbc22a64-4bdc-4974-8e5c-55681c6bc896\"><\/a><\/h4><p>Here's a list of the functions I find most useful to aid in deployment.<\/p><div><ul><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/fullfile.html\">fullfile<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/fileparts.html\">fileparts<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/pathsep.html\">pathsep<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/filesep.html\">filesep<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/mfilename.html\">mfilename<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/compiler\/ctfroot.html\">ctfroot<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlabroot.html\">matlabroot<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/compiler\/ismcc.html\">ismcc<\/a><\/tt>, <tt><a href=\"https:\/\/www.mathworks.com\/help\/compiler\/isdeployed.html\">isdeployed<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/startup.html\">startup<\/a><\/tt>, <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/finish.html\">finish<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/tempdir.html\">tempdir<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/try.html\">try<\/a><\/tt>, <tt><a title=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/catch.html (link no longer works)\">catch<\/a><\/tt>, <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/mexception-class.html\">MException<\/a><\/tt><\/li><li><tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.io.savevariablestoscript.html\">matlab.io.SaveVariablesToScript<\/a><\/tt><\/li><\/ul><\/div><h4>Other Helpful Functions?<a name=\"45552d61-ccba-4080-86bd-a0778b75eb37\"><\/a><\/h4><p>Do you have other functions that ease your transition to deploying your app?  Let me know <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=2478#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_3540bb3ee14a4b8dafaa93e18ab9bad4() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='3540bb3ee14a4b8dafaa93e18ab9bad4 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 3540bb3ee14a4b8dafaa93e18ab9bad4';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2017 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_3540bb3ee14a4b8dafaa93e18ab9bad4()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2017b<br><\/p><\/div><!--\r\n3540bb3ee14a4b8dafaa93e18ab9bad4 ##### SOURCE BEGIN #####\r\n%% Tips for Deploying your Work\r\n% There are a lot of ways of sharing your ideas with MATLAB these days.\r\n% Including\r\n%\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/create-scripts.html\r\n% MATLAB scripts> and <https:\/\/www.mathworks.com\/help\/matlab\/functions.html\r\n% functions>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/create-live-scripts.html Live scripts>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/workspace.html MAT-files>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/creating_guis\/apps-overview.html\r\n% Apps>\r\n% * Code generation of various kinds, e.g., <https:\/\/www.mathworks.com\/help\/coder\/index.html C\/C++> and <https:\/\/www.mathworks.com\/help\/gpucoder\/index.html GPU> via Coder\r\n% products\r\n% * <https:\/\/www.mathworks.com\/help\/compiler\/matlab-compiler.html MATLAB Compiler>  and <https:\/\/www.mathworks.com\/help\/compiler_sdk\/index.html SDK> (stand-alone apps and code suitable for\r\n% integrating into other environments)\r\n% * <https:\/\/www.mathworks.com\/help\/mps\/index.html MATLAB Production\r\n% Server>\r\n%\r\n% Today I want to remind you of some tools in MATLAB that can facilitate\r\n% the transition to code you want to deploy via the MATLAB Compiler and\r\n% SDK.\r\n%\r\n%% Useful Functions for Deployment\r\n% Here's a list of the functions I find most useful to aid in deployment.\r\n%\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/fullfile.html fullfile>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/fileparts.html fileparts>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/pathsep.html pathsep>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/filesep.html filesep>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/mfilename.html mfilename>| \r\n% * |<https:\/\/www.mathworks.com\/help\/compiler\/ctfroot.html ctfroot>| \r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlabroot.html matlabroot>| \r\n% * |<https:\/\/www.mathworks.com\/help\/compiler\/ismcc.html ismcc>|,\r\n% |<https:\/\/www.mathworks.com\/help\/compiler\/isdeployed.html isdeployed>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/startup.html startup>|,\r\n% |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/finish.html finish>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/tempdir.html tempdir>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/try.html try>|, |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/catch.html catch>|, |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/mexception-class.html MException>|\r\n% * |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.io.savevariablestoscript.html matlab.io.SaveVariablesToScript>|\r\n%\r\n%% Other Helpful Functions?\r\n% Do you have other functions that ease your transition to deploying your\r\n% app?  Let me know <https:\/\/blogs.mathworks.com\/loren\/?p=2478#respond\r\n% here>.\r\n##### SOURCE END ##### 3540bb3ee14a4b8dafaa93e18ab9bad4\r\n-->","protected":false},"excerpt":{"rendered":"<!--introduction--><p>There are a lot of ways of sharing your ideas with MATLAB these days. Including... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2017\/11\/28\/tips-for-deploying-your-work\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2478"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=2478"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2478\/revisions"}],"predecessor-version":[{"id":2482,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2478\/revisions\/2482"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=2478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=2478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=2478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}