Commit e022f44d authored by Nicola Carmignani's avatar Nicola Carmignani

Merge branch 'matlabpath' into 'master'

Matlabpath

See merge request !4
parents bbf76262 6c22905e
......@@ -14,8 +14,8 @@ Please check that the software works correctly as operator (CTRM) and files are
this respository should be pulled (git pull) in /operation/machine/BeamDynamics/matlab
to set the matlab path as default:
copy startup.m in ~/matlab/startup.m
edit startup.m variable rootpath to match the location where you downloaded this repository.
edit your private ~/matlab/startup.m
call or copy there the relevant content of startmachine.m.
Please see the wiki for the expected folders (AT, tango-maltab) to be installed separately
......
......@@ -33,34 +33,5 @@ if isempty(APPHOME), APPHOME=getenv('APPHOME'); end
function optpath(varargin)
for i=nargin:-1:1
if (exist(varargin{i},'dir') == 7), addpath(genp(varargin{i})); end
end
function p = genp(d)
classsep = '@'; % qualifier for overloaded class directories
packagesep = '+'; % qualifier for overloaded package directories
skipc=['.' classsep packagesep];
skips={'CVS','private','obsolete'};
p = ''; % path to be returned
files = dir(d);
if ~isempty(files)
% Add d to the path even if it is empty.
p = [p d pathsep];
% set logical vector for subdirectory entries in d
isdir = logical(cat(1,files.isdir));
%
% Recursively descend through directories which are neither
% private nor "class" directories.
%
dirs = files(isdir); % select only directory entries from the current listing
for i=1:length(dirs)
dirname = dirs(i).name;
if ~(any(dirname(1)==skipc) || any(strcmp(dirname,skips)))
p = [p genp(fullfile(d,dirname))]; %#ok<AGROW> % recursive calling of this function.
end
end
if (exist(varargin{i},'dir') == 7), addpath(genpath(varargin{i})); end
end
curdir = pwd;
rootpath = '/machfs/liuzzo/EBS/Simulator/BeamDynamics/matlab';
if (~isdeployed) % will be executed only from matlab, not from C
msg = [' Loading path from ' fullfile(rootpath,'startmachine.m') ' '];
disp(['*** ' repmat(' ',1,length(msg)) ' ***']);
disp(['*** ' msg ' ***'])
disp(['*** ' repmat(' ',1,length(msg)) ' ***']);
cd(rootpath)
startmachine; % build standard path for operation
cd(curdir)
addpath(genpath('~/matlab'));
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment