datastore and .mat files

32 visualizaciones (últimos 30 días)
minomi
minomi el 31 de Jul. de 2018
Respondida: Harsh el 1 de Ag. de 2018
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?

Respuestas (1)

Harsh
Harsh el 1 de Ag. de 2018
You can use fileDatastore for .mat files. An example of this can be found in the doc here .

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by