%% Read All Data in CombinedDatastore
% Create a datastore that maintains parity between the pair of images of the underlying datastores. For instance, create two separate image datastores, and then create a combined datastore representing the two underlying datastores.
% Create an image datastore imds1 representing a collection of three images.

imds1 = imageDatastore({'street1.jpg','street2.jpg','peppers.png'}); 

% Create a second datastore imds2 by transforming the images of imds1 to grayscale and then downsizing the images.

imds2 = transform(imds1,@(x) imresize(im2gray(x),0.5));

% Create a combined datastore from imds1 and imds2.

imdsCombined = combine(imds1,imds2);

% Read all of the data from the combined datastore. The output is a 3-by-2 cell array. The two columns represent all of the read data from the two underlying datastores imds1 and imds2, respectively.

dataOut = readall(imdsCombined)

% Copyright 2018 The MathWorks, Inc.