DMPexcel2mat.m refactor
This commit is contained in:
@@ -186,7 +186,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
||||
disp(strcat('Using matching DrugMedia file: ', drugMediaFile, ', skipping directory selection'));
|
||||
else
|
||||
% Try to find the DrugMedia file automatically (newest created first)
|
||||
files=dir(matDir)
|
||||
files=dir(matDir);
|
||||
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
||||
if isempty(dmFiles)
|
||||
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
||||
@@ -210,7 +210,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
||||
questdlg('Select DrugMedia directory','Directory Selection','OK',...
|
||||
struct('Default','OK','Interpreter','tex'))
|
||||
dirToScan=uigetdir();
|
||||
files=dir(dirToScan)
|
||||
files=dir(dirToScan);
|
||||
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
||||
if isempty(dmFiles)
|
||||
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
||||
@@ -222,12 +222,11 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
||||
catch ME
|
||||
h=msgbox(ME.message, 'Error', 'error');
|
||||
uiwait(h);
|
||||
disp('Rerunning directory selection')
|
||||
disp('Rerunning directory selection');
|
||||
% I don't know what else we'll need to do here
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
disp(strcat('Using drugMediaFile: ', drugMediaFile, ', skipping directory selection'));
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user