datastore and .mat files
조회 수: 32 (최근 30일)
이전 댓글 표시
I have a few .mat files containing a table of variables. I tried using datastore for the files so that then I can create timetables and apply timerange to select the rows of data within the specificed time. my scripts looks like this:
warning off
ds_loc = 'Z:\Desktop\*.mat';
ds = datastore(ds_loc);
ds.Delimiter = ' ';
ds.MultipleDelimitersAsOne = 1;
ds.SelectedFormats(1) = {'%{dd/MM/yyyy HH:mm:ss}D'};
warning on
tt = tall(ds);
ttab = table2timetable(tt)
strt_time = '03/12/2018 10:00:00'
end_time = '03/13/2018 00:00:00'
warning off
S1 = timerange(strt_time,end_time);
warning on
S2 = ttab(S1,:)
this script works fine with .txt files but with .mat files I get the error:
Error using datastore (line 114)
Cannot determine the datastore type for the specified location.
Specify the 'Type' name-value pair argument to indicate the type of datastore to create.
Error in cls_test (line 10)
ds = datastore(ds_loc);
Please could someone advise on what I'm doing wrong?
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!