{"id":214,"date":"2008-05-27T08:53:49","date_gmt":"2008-05-27T13:53:49","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2008\/05\/27\/getting-to-your-configurations\/"},"modified":"2008-05-27T08:53:49","modified_gmt":"2008-05-27T13:53:49","slug":"getting-to-your-configurations","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2008\/05\/27\/getting-to-your-configurations\/","title":{"rendered":"Getting to your configurations"},"content":{"rendered":"<p>Back when we introduced configurations in R2007b (see <a href=\"https:\/\/blogs.mathworks.com\/community\/2007\/09\/17\/running-functions-with-input-from-the-editor-in-r2007b\/\">this blog entry<\/a>), one of the first questions brought up by customers was &#8220;where are the configurations stored and what format are they in?&#8221;. A completely understandable request, as it can be disconcerting to put time and energy into something and not know what controls the fate of your hard work (i.e. what happens if I upgrade MATLAB or move to another machine?).<\/p>\n<p>We heard your requests and have made both run and publish configurations accessible. You can find your configurations by <a href=\"https:\/\/www.mathworks.com\/access\/helpdesk\/help\/techdoc\/index.html?\/access\/helpdesk\/help\/techdoc\/ref\/cd.html\"><tt>cd<\/tt><\/a>&#8216;ing to <a href=\"https:\/\/www.mathworks.com\/access\/helpdesk\/help\/techdoc\/index.html?\/access\/helpdesk\/help\/techdoc\/ref\/prefdir.html\"><tt>prefdir<\/tt><\/a>:<\/p>\n<pre>\r\n>> cd(prefdir)\r\n<\/pre>\n<p>You&#8217;ll find a number of files in this directory &#8211; the two we&#8217;re interested in are <b>run_configurations.m<\/b> and <b>publish_configurations.m<\/b>. These two files are both MATLAB files that use cell mode. You can open up the raw run and publish configuration storage files in the MATLAB editor for viewing, but you shouldn&#8217;t edit these files directly (see note below). <\/p>\n<p><i>NOTE: Do not edit run_configuration.m or publish_configuration.m within the MATLAB Editor &#8211; use either the Configuration Editor, or modify the files from a text editor when MATLAB is not running.<\/i><\/p>\n<p>Here&#8217;s what the beginning of my run_configurations.m file looks like:<\/p>\n<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\"><span style=\"color: #228B22\">% MATLAB Run Configurations<\/span>\r\n<span style=\"color: #228B22\">% @version 2<\/span>\r\n<span style=\"color: #228B22\">% It is recommended that you do not edit this file directly, but use the<\/span>\r\n<span style=\"color: #228B22\">% Configuration Editor provided in MATLAB. Changes made to comments that<\/span>\r\n<span style=\"color: #228B22\">% exist outside of a configuration will not be saved.<\/span>\r\n\r\n<span style=\"color: #228B22\">%% @name foo<\/span>\r\n<span style=\"color: #228B22\">%  @associatedFile \/mathworks\/home\/korr\/Desktop\/foo.m<\/span>\r\n<span style=\"color: #228B22\">%  @mostRecentlyActioned false<\/span>\r\n<span style=\"color: #228B22\">%  @uniqueId -4e3eabb0:11a2a50508e:-7f8f<\/span>\r\n\r\n<span style=\"color: #228B22\">% Modify expression to add input arguments.<\/span>\r\n<span style=\"color: #228B22\">% Example:<\/span>\r\n<span style=\"color: #228B22\">%   a = [1 2 3; 4 5 6];<\/span>\r\n<span style=\"color: #228B22\">%   foo(a);<\/span>\r\n\r\nx = 1:100;\r\nfoo(x);\r\ndisp(<span style=\"color: #A020F0\">'Done running foo.'<\/span>);<\/pre>\n<\/div>\n<p>You can share this file with others, though there currently isn&#8217;t a way to import another run or publish configuration file. With MATLAB shutdown, the receiving user can either copy and paste the desired configurations into his own configurations file or rename his configurations file from run_configurations.m to something like run_configurations_old.m.<\/p>\n<p>If the receiving user doesn&#8217;t have a MATLAB file that a configuration is linked to, the Configuration Editor will indicate the problem by placing a red x next to the file name:<\/p>\n<div align=\"center\"><a  href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/\/ken_orr_getting_to_your_configurations\/configuration_editor_error.jpg\"><img decoding=\"async\"  border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/\/ken_orr_getting_to_your_configurations\/configuration_editor_error_small.jpg\"><\/a><\/div>\n<p>To fix this problem, point the Configuration Editor to the MATLAB file that the configuration corresponds to by editing the <b><i>Associated M-File<\/i><\/b> text field, or by clicking <b><i>Choose&#8230;<\/i><\/b> to navigate to the file.<\/p>\n<p>We&#8217;d love to here what enhancements you would like to see in the Configuration Editor!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back when we introduced configurations in R2007b (see this blog entry), one of the first questions brought up by customers was &#8220;where are the configurations stored and what format are they&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2008\/05\/27\/getting-to-your-configurations\/\">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":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/214"}],"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=214"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/214\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}