Main Content



(Not recommended) Read data from custom mini-batch datastore

The read method of is not recommended. For more information, see Compatibility Considerations.


data = read(ds) returns data from a mini-batch datastore. Subsequent calls to the read function continue reading from the endpoint of the previous call.

[data,info] = read(ds) also returns information about the extracted data in info, including metadata.

Input Arguments

expand all

Mini-batch datastore, specified as a built-in datastore or custom mini-batch datastore. For more information, see Datastores for Deep Learning.

Output Arguments

expand all

Output data, returned as a table with MiniBatchSize number of rows. For the last mini-batch of data in the datastore, if NumObservations is not evenly divisible by MiniBatchSize, then data should contain the remaining observations in the datastore (a partial batch smaller than MiniBatchSize).

The table should have two columns, with predictors in the first column and responses in the second column.

Information about read data, returned as a structure array.



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2018a

expand all

Not recommended starting in R2019a