data = readall(ds)
returns all the data in the datastore specified by ds. If all the
data in the datastore does not fit in memory, then readall
returns an error.
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.
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.
Combined and transformed datastores — Datastores created using
the combine and transform functions.
Custom datastores — Datastores created using the custom
datastore framework. See Develop Custom Datastore.
tf — Read in parallel false (default) | true
Read in parallel, specified as true or
false. If you specify true,
readall reads all data from the datastore in parallel
(requires Parallel Computing Toolbox). Parallel reading may result in improved performance when
reading data, especially with remote data.
Datastore processing can be improved with the
UseParallel property and theParallel Computing Toolbox. readall reads supported datastores
faster on the local machine by using low overhead computing
environments such as thread-based parallel pools. For more
information on thread-based parallel pools see parpool (Parallel Computing Toolbox).
As a result of MATLAB's built-in multithreading, certain datastores (for
example, imageDatastore) perform faster on the
local machine when not using parallelism based on MATLAB workers. For more information see MATLAB Multicore.
data — All data in the datastore table | cell array
All data in the datastore, returned as a table or a cell array depending
on the type of ds.
Type of Datastore
Data type of data
Description
TabularTextDatastore and
SpreadsheetDatastore
Table
The SelectedVariableNames property
determines the table variables.
ImageDatastore
Cell array
Each element in the cell array contains the image data
for one image. The readall function
supports all image types supported by the
imread function. For more information
on the supported image types, see imread.
KeyValueDatastore
Table
The table variable names are Key and
Value.
FileDatastore
Cell array
Each element in the cell array contains the data read
from one file using the custom read function specified by
the ReadFcn property.
TransformedDatastore
Varies
The output is the same as the output returned by the
underlying datastore specified by the
UnderlyingDatastores property. For
example, if the underlying datastore is an image datastore,
then data is returned as a cell array
where each element in the cell array contains the image data
for one image.
CombinedDatastore
Cell array
Each column of the cell array contains the result
from calling readall on the
corresponding underlying datastore specified by the
UnderlyingDatastores
property.
If the number of subsets of data
in the underlying datastores differs, then
readall only returns data while
all underlying datastores have data. For example,
suppose a combined datastore has two underlying
datastores, one with m subsets of
data and one with n subsets of data,
where m > n. The
output is a cell array with two columns and
n rows.
Extended Capabilities
Automatic Parallel Support Accelerate code by automatically running computation in parallel using Parallel Computing Toolbox™.
To run in parallel, set the 'UseParallel' option to true.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.