Which files or folders of MATLAB installations should be under revision control?
I don't mean my code, models etc but MATLABs configuration files, application data and so on. Everything that's needed to ensure that all my team have the same setup.
Which files or folders of MATLAB installations should be under revision control?
I don't mean my code, models etc but MATLABs configuration files, application data and so on. Everything that's needed to ensure that all my team have the same setup.
The best way to manage this is through the use of an initialization script. Put this in the top level project folder, and name it something nice:
%% initMyProject.m
% RestoreDefault
restoredefaultpath();
set(0,'userdata',[]);
clear classes;
javaclasspath({});
% Matlab
addpath(fullfile(pwd,'lib','subdirA'))
addpath(fullfile(pwd,'lib','subdirB')) % ..etc
% Java
addpath(fullfile(pwd,'java','myJarA.jar')
addpath(fullfile(pwd,'java','myJarB.jar') % ..etc
% Rendering
opengl('hardware');
% Solver
setparam(...)
disp('Initialization complete.')
The user would then edit a startup.m
(as described here), to call the init script. This file should be placed in the Linux user's home directory, or the C:/Users//Documents/Matlab directory (Windows):
% startup.m
cd('C:\workspace\myProjectCheckout')
initMyProject()
This approach has a number of benefits:
The restoreDefault methods are a bit heavy-handed, but they do guarantee a clean environment, so use as necessary.