0001 function [zPathName,zFileName,zf] = VMT_SelectFiles;
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 defaultpath = 'C:\';
0016 matpath = [];
0017 if 0
0018 load('VMT\LastDir.mat');
0019 if exist(matpath,'dir') == 7
0020 matpath = uigetdir(matpath,'Select the Directory Containing Processed Data Files (*.mat)');
0021 else
0022 matpath = uigetdir(defaultpath,'Select the Directory Containing Processed Data Files (*.mat)');
0023 end
0024 else
0025 matpath = uigetdir(defaultpath,'Select the Directory Containing Processed Data Files (*.mat)');
0026 end
0027 zPathName = matpath;
0028 Files = dir(zPathName);
0029 allFiles = {Files.name};
0030 filefind=strfind(allFiles,'.mat')';
0031 filesidx=nan(size(filefind,1),1);
0032 for i=1:size(filefind,1)
0033 filesidx(i,1)=size(filefind{i},1);
0034 end
0035 filesidx=find(filesidx>0);
0036 files=allFiles(filesidx);
0037
0038 if isempty(files)
0039 errordlg(['No *.MAT files found in ' matpath '. Ensure you have chosen the correct directory and VMT processed files are present.']);
0040 end
0041
0042
0043 selection = listdlg('ListSize',[300 300],'ListString', files,'Name','Select Data Files');
0044 zFileName = files(selection);
0045
0046
0047 if isa(zFileName,'cell')
0048 zf=size(zFileName,2);
0049 zFileName = sort(zFileName);
0050 else
0051 zf=1;
0052 zFileName={zFileName}
0053 end
0054
0055
0056
0057
0058
0059
0060