Datastore - support for mat-files
古いコメントを表示
I am trying to use the tall array functionality to sort a very large table, as well as other calculations. The tables are currently stored in several mat-files. When trying to create a datastore object to be used as input to the tall arrays, using one or more mat-file as inputs does not seem to be possible.
Am I missing something? Do I have to export the data to some other format to use as input for the datastore object? Any input would be appreciated.
採用された回答
その他の回答 (3 件)
Steven Lord
2017 年 6 月 14 日
2 投票
Have you seen this example in the documentation? Alternately, the documentation page for FileDatastore includes an example that creates a datastore for a collection of MAT-files. That might allow you to turn your collection of table arrays into a tall table.
bigdataanalyses
2021 年 11 月 9 日
0 投票
Hoping this helps someone:
Task at hand: After producing one very large 2D-table in Matlab via smaller table excerpts, I save each excerpt as a separate .mat-file. However, the re-loading causes problems.
Problem: Re-loading the tables stored as .mat via fileDatastore( ) and then transforming them to tall( ) makes each row in the table its own subtable.
Solution: After some trial-and-error, this works:
ds = fileDatastore(fullfile('input','database_regdata_*.mat'),... % the * is for the numbering of the outputted files
'ReadFcn', @(x)struct2table(load(x)), ... % Try to convert structure to table to avoid error in tall( )
"FileExtensions",".mat",...
"UniformRead", true); % one big table with same variables, o/w error
% Turn datastore into tall array for analysis out of memory.
tt = tall(ds);
ttt = vertcat(tt{:,:});
カテゴリ
ヘルプ センター および File Exchange で Text Data Preparation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!