## MATLAB CommunityMATLAB, community & more

Back when we introduced configurations in R2007b (see this blog entry), one of the first questions brought up by customers was “where are the configurations stored and what format are they in?”. 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?).

We heard your requests and have made both run and publish configurations accessible. You can find your configurations by cd‘ing to prefdir:

>> cd(prefdir)


You’ll find a number of files in this directory – the two we’re interested in are run_configurations.m and publish_configurations.m. 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’t edit these files directly (see note below).

NOTE: Do not edit run_configuration.m or publish_configuration.m within the MATLAB Editor – use either the Configuration Editor, or modify the files from a text editor when MATLAB is not running.

Here’s what the beginning of my run_configurations.m file looks like:

% MATLAB Run Configurations
% @version 2
% It is recommended that you do not edit this file directly, but use the
% exist outside of a configuration will not be saved.

%% @name foo
%  @associatedFile /mathworks/home/korr/Desktop/foo.m
%  @mostRecentlyActioned false
%  @uniqueId -4e3eabb0:11a2a50508e:-7f8f

% Modify expression to add input arguments.
% Example:
%   a = [1 2 3; 4 5 6];
%   foo(a);

x = 1:100;
foo(x);
disp('Done running foo.');

You can share this file with others, though there currently isn’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.

If the receiving user doesn’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:

To fix this problem, point the Configuration Editor to the MATLAB file that the configuration corresponds to by editing the Associated M-File text field, or by clicking Choose… to navigate to the file.

We’d love to here what enhancements you would like to see in the Configuration Editor!

### Note

Sung Soo Kim replied on : 1 of 9
Hi Ken, I found this site today, and I love it! BTW, I have a question related to desktop configuration. I'm currently doing two completely separate projects, and I want to open completely two separate Matlab workspace and desktop so that I don't have to be confused by mixed list of m-files from two exclusive projects. For example, one matlab desktop with "current directory" of the first project, and opened m-files only related to that project. And the other matlab desktop with "current directory" of the other project and related to only the second project in the editor. For now, I made two Windows accounts and switching user to use separate configuration for each project, which is really uncomfortable, because I couldn't find a way to keep two completely separate desktop configuration. Each instance of matlab saves only one information about opened m-files, current directories, and so on. Even though I can use separate configuration files, the list of opened m-files etc cannot be saved separately. Is there a way to accomplish my goal?
Ken replied on : 2 of 9
Hi Sung Soo Kim, There's not a great solution right now for what your trying to do. We do have a team looking at your specific use case and assessing how best to address that in the MATLAB Desktop. Sorry I don't have a better answer for you! -Ken
Sung Soo Kim replied on : 3 of 9