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