Loren's blog on datastore. How should I use counterSize and done?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to use datastore in Matlab v2018b but it does not have 'partialread'.
I am trying to replicate Loren's code (https://blogs.mathworks.com/loren/2019/05/29/big-data-in-mat-files/ and the section 'Use a portion of all variables') for a large variable whose size exceeds memory.
Unfortunately its written kind of poorly with many variables thrown in and not explained. For example, I cannot figure out how to use 'done' and 'counterSize'.
I tried
[fds_partial, counter, done] = fileDatastore("smallVars*.mat", "ReadFcn", @partialReadFcn, "UniformRead", true);
But I get an error of 'too many output arguments'
I tried
[M, counter, done] = read(fds_partial) %with
fds_partial = fileDatastore("smallVars*.mat", "ReadFcn", @partialReadFcn, "UniformRead", true);
Again I get an error of too many output arguments.
So I end up reading only one block of file and the readfcn function does not proceed beyond one block.
So what gives?
回答 (2 件)
Adam Danz
2021 年 11 月 28 日
> I am trying to use datastore in Matlab v2018b but it does not have 'partialread'.
partialreadFcn is a function defined in Loren's blog post. No currently existing release of Matlab has a "partialread" function.
> I cannot figure out how to use 'done' and 'counterSize'.
done appears to be a flag (true|false) indicating whether there is more to read or not.
There is no variable named counteSize.
> But I get an error of 'too many output arguments'
fileDatastore only has 1 output.
doc fileDatastore
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!