From a5b46cd9f56044ed12298e7153bf56fce3dd187e Mon Sep 17 00:00:00 2001 From: Antoine Merle <Antoine.Merle@epfl.ch> Date: Tue, 17 Jul 2018 13:12:58 +0000 Subject: [PATCH] Add possibility to remove gdat paths. git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@10451 d63d8f72-b253-0410-a779-e742ad2e26cf --- crpptbx/gdatpaths.m | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crpptbx/gdatpaths.m b/crpptbx/gdatpaths.m index 9313eba0..d7c25339 100644 --- a/crpptbx/gdatpaths.m +++ b/crpptbx/gdatpaths.m @@ -1,19 +1,27 @@ -function gdatpaths +function gdatpaths(remove) % % add paths for gdat directory % % assumes gdat already available % +if nargin < 1 + remove = false; +end + a=which('gdat'); if isempty(a), error('gdat is not in the MATLAB path'); end a = fileparts(a); -machines=[{'JET'} {'TCV'} {'AUG'} {'D3D'}]; -machines=[{'JET'} {'TCV'} {'AUG'} {'KSTAR'}]; +% machines=[{'JET'} {'TCV'} {'AUG'} {'D3D'}]; +% machines=[{'JET'} {'TCV'} {'AUG'} {'KSTAR'}]; machines=[{'JET'} {'TCV'} {'AUG'} {'D3D'} {'KSTAR'}]; add_paths = cell(1,length(machines)); for i=1:length(machines) add_paths{i}=fullfile(a,machines{i}); end -addpath(add_paths{:}); +if ~remove + addpath(add_paths{:}); +else + rmpath(add_paths{:}); +end -- GitLab