matlab.io.Datastore Class
Namespace: matlab.io
Base datastore class
Description
matlab.io.Datastore
is an abstract class for creating a custom
datastore. A datastore helps access large collections of data iteratively, especially
when data is too large to fit in memory. The Datastore
abstract class
declares and captures the interface expected for all custom datastores in MATLAB®. Derive your class using this
syntax:
classdef MyDatastore < matlab.io.Datastore ... end
To implement your custom datastore:
Inherit from the class
matlab.io.Datastore
Define the four required methods:
hasdata
,read
,reset
, andprogress
For more details and steps to create your custom datastore, see Develop Custom Datastore.
Methods
read | Read data from the datastore.
The The data type of the output
|
hasdata | Determine if data is available to read. The output is of type logical.
|
reset | Reset the datastore to an initial state before any data is read.
|
progress | Determine how much data is already read. The output
is a scalar double between
|
preview | Return a subset of the data.
The default implementation
returns the first eight rows of data. The output has the same data
type as the output of The
default implementation of the
|
readall | Read all data in the datastore.
The output has the same data
type as the output of The default implementation of the
|
combine | Combine data from multiple datastores.
The output
|
transform | Transform the datastore.
The output
|
isPartitionable | Determine whether datastore is partitionable. The output is of type logical.
|
isSubsettable | Determine whether datastore is subsettable. The output is of type logical.
|
isShuffleable | Determine whether datastore is shuffleable. The output is of type logical.
|
Properties
To add handle properties to your custom datastore, you must implement the
copyElement
method. For example, if you use the
DsFileSet
object as a property in your custom datastore, then
implement the copyElement
method. Implementing the
copyElement
method enables you to create a deep copy of the
datastore object. For more information, see Customize Copy Operation.
For an example implementation of the copyElement
method, see Develop Custom Datastore.
Examples
Version History
Introduced in R2017b