Robochameleon  v1.0
robochameleon.m
Go to the documentation of this file.
1 
2 function robochameleon(varargin)
3 
4 mlock; % Protect function against clear
5 persistent ROBO; if isempty(ROBO), ROBO = false; end % Initialize ROBO on creation
6 resetFlag = false;
7 if nargin > 0
8  resetFlag=varargin{1};
9 end
10 if resetFlag
11  restoredefaultpath
12 end
13 
14 if ~ROBO || resetFlag % Check if previous initialization was successful
15  root = mfilename('fullpath');
16  root = root(1:find(root==filesep,1,'last')-1); % Get directory of this file
17  setpref('robochameleon','roboRootFolder',root);
18 
19  fprintf(1,'Initializing Robochamelon. Adding directories to path:\n');
20  fprintf('-> %s\n',root);
21  addpath(root);
22 
23  dirs = {'addons', 'base', 'files', 'library', 'utils', 'devel', 'lab', 'view'};
24  % Add user defined directories to path
25  if ispref('robochameleon', 'extrapathdirs')
26  extradirs=getpref('robochameleon', 'extrapathdirs');
27  dirs = [dirs extradirs];
28  end
29 
30 
31  for i=1:numel(dirs)
32  add = [root filesep dirs{i}];
33  fprintf('-> %s\\*\n',add);
34  addpath(genpath(add));
35  end
36 
37  if verLessThan('matlab', '8.1.0')
38  fprintf(1, 'Adding compatibility layer for MATLAB releases before 8.1.0 (R2013a).\n');
39  addpath(genpath(fullfile(root, 'compatibility', '8.1')));
40  end
41 
42  if verLessThan('matlab', '8.5.0')
43  fprintf(1, 'Adding compatibility layer for MATLAB releases before 8.5.0 (R2015a).\n');
44  addpath(genpath(fullfile(root, 'compatibility', '8.5')));
45  end
46  v = ver('bioinfo');
47  if isempty(v)
48  fprintf(1, 'Adding compatibility layer bioinfo_lite.\n');
49  addpath(genpath(fullfile(root, 'compatibility', 'bioinfo_lite')));
50  end
51  v = ver('stats');
52  if isempty(v)
53  fprintf(1, 'Adding compatibility layer stats_lite.\n');
54  addpath(genpath(fullfile(root, 'compatibility', 'stats_lite')));
55  end
56 
57  % Disable warnings
58  warning('off','catstruct:DuplicatesFound');
59 
60  ROBO = true;
61 end
function catstruct(in varargin)
Concatenate or merge structures with different fieldnames.
function robochameleon(in varargin)
Add robochameleon related directories to the MATLAB path.
function end(in obj, in k, in n)
Overload of indexing end statement.