/usr/share/psychtoolbox-3/PsychOneliners/AddToMatlabPathDynamically.m is in psychtoolbox-3-common 3.0.12.20160126.dfsg1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | function AddToMatlabPathDynamically(directory)
% AddToMatlabPathDynamically(directory)
%
% Add the directory and its subdirectories to Matlab's path, dynamically,
% with strippint out of .svn and .git directories.
%
% Use for for putting routines onto path that are specifict to a particular
% project, without them staying around and clogging up the name space.
%
% Typical usages:
% a) When getting version info
% exp.mFileName = mfilename;
% [exp.versionInfo,exp.codeDir] = GetAllVersionInfo(exp.mFileName);
% AddToMatlabPathDynamically(exp.codeDir);
%
% b) Direct call
% AddToMatlabPathDynamically( fileparts(which(mfilename)));
%
% 7/12/13 dhb Wrote it.
% 7/25/14 dhb Make independent of BrainardLab idiosyncracies.
%% Dynamically add the program code to the path if it isn't already on it.
if isempty(strfind(path, directory))
fprintf('- Adding %s dynamically to the path...', directory);
thePath = RemoveMatchingPaths(genpath(directory),[filesep '.svn']);
thePath = RemoveMatchingPaths(thePath,[filesep '.git']);
addpath(thePath, '-end');
fprintf('Done\n');
end
|