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!