Use date strings to specify date range of matfiles to process
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi Guys
I have the following file structure
VehicleName\Matfiles\Month\VehicleName_Registration_Type_yymmdd.mat
Currently I can only process data from a vehicles month folder.
I want to compare data for the same vehicle but in a specified date range
e.g
130101-130210
this would take me across two month folders and also only use data until the 10th of Feb.
My Current Code is
VehicleInfo=find(ismember(FTDatabase(:,1),VehicleName));
if isempty(VehicleInfo)
error([VehicleName, ' is not in vehicle database'])
end
Database1 = Database{VehicleInfo, 2};
Database2 = Database{VehicleInfo, 3};
Database3 = Database{VehicleInfo, 4};
Database4 = Database{VehicleInfo, 5};
end
MATfileDIR = ([ DataLocation,'\',Program,'\',Application,'\' VehicleName,'\MatData_Files','\',Month,'_matfiles']);
MatFiles = what(MATfileDIR);
DayFiles=MatFiles.mat;
i=0;
for WhichMat = 1:length(DayFiles);
SelectedMat = DayFiles{WhichMat};
StructureName = DayFiles;
MATfile = ([MATfileDIR, '\', SelectedMat]);
index = strfind(SelectedMat,'_');
S = SelectedMat(index(end):end); % Supplied By Jan Simon
DateVal= {[S(6:7),S(4:5),S(2:3)];};% Supplied by Jan Simon
DateNum = datenum(DateVal,'ddmmyy');
Date = DateNum;
i =i+1;
DATA = load(MATfile);
disp({'Loading' , SelectedMat})
Database holds the vital information for each vehicle. So the end result that I cant get to work is MATfile being a list of the filepath of all the matfiles that have the correct date range
댓글 수: 3
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!