%% Read Data in KeyValueDatastore
% Create a datastore from the sample file, mapredout.mat, which is the output file of the mapreduce function.

ds = datastore('mapredout.mat');

%
% Read a subset of data in the datastore.

T = read(ds)

%
% Change the number of key-value pairs to read at a time, by changing the ReadSize property of the datastore.

ds.ReadSize = 5;

%
% Read the next five key-value pairs in the datastore.

T = read(ds)

% Copyright 2015 The MathWorks, Inc.