-
Notifications
You must be signed in to change notification settings - Fork 8
/
cdsbe.m
executable file
·33 lines (28 loc) · 1.09 KB
/
cdsbe.m
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
30
31
32
33
function curr_path=cdsbe(filename)
%CDSBE - A helper function to change working directory to SBEToolbox directory.
%
% Systems Biology and Evolution Toolbox (SBEToolbox).
% Authors: James Cai, Kranti Konganti.
% (C) Texas A&M University.
%
% $LastChangedDate: 2013-01-01 13:33:15 -0600 (Tue, 01 Jan 2013) $
% $LastChangedRevision: 296 $
% $LastChangedBy: jcai $
%
%curr_path = fileparts(which(filename));
pw0=pwd;
pw1=fileparts(which(mfilename));
if ~strcmp(pw0,pw1)
[selectedButton,dlgShown]=uigetpref('SBEToolbox',... % Group
'cdsbe_ask',... % Preference
'Changing Working Directory',... % Window title
{'Do you want to change current working directory to SBEToolbox directory?'},...
{'always','never';'Yes','No'},... % Values and button strings
'ExtraOptions','Cancel',... % Additional button
'DefaultButton','Yes');
switch selectedButton
case {'always','Yes'}
cd(pw1);
case {'never','No','Cancel'}
end
end