%% Create a Blocked File-Set and Get Information on All Files
% Create a blocked file-set and query information for specific blocks in the blocked file-set.
% Create a blocked file-set bs for a collection of files and specify the block size.

folder = {'accidents.mat','airlineResults.mat','census.mat','earth.mat'}
bs = matlab.io.datastore.BlockedFileSet(folder,'BlockSize',2000)

% Obtain information for specific blocks using either the nextblock function or by querying the BlockInfo property and specifying an index. Obtain information for consecutive blocks using nextblock. For example, obtain information for the first two blocks in the set.

blk1 = nextblock(bs)
blk2 = nextblock(bs)

% Query the BlockInfo property to get information about the last block in the set.

lastblk = bs.BlockInfo(98)

% Copyright 2019 The MathWorks, Inc.
%