matlab.io.datastore.FileWritable Class
Namespace: matlab.io.datastore
Add file writing support to datastore
Description
matlab.io.datastore.FileWritable is an abstract mixin class that adds file
writing support to custom datastores by adding support for the writeall
method.
To use this mixin class, you must inherit from the
matlab.io.datastore.FileWritable class and the matlab.io.Datastore
base class. Use this syntax as the first few lines in your class definition
file:
classdef MyDatastore < matlab.io.Datastore & .... matlab.io.datastore.FileWritable ... end
Inherit from an additional class
matlab.io.datastore.FileWritable.Initialize the properties
SupportedOutputFormatsandDefaultOutputFormat.Implement a
writemethod if the datastore writes data to a custom format.Implement a
getFilesmethod if the datastore does not have aFilesproperty.Implement a
getFoldersmethod if the datastore does not have aFoldersproperty.The output location is validated as a string. If your datastore requires further validation, you must implement a
validateOutputLocationmethod.If the datastore is meant for files that require multiple reads per file, then you must implement the methods
getCurrentFilenameandcurrentFileIndexComparator.Optionally, inherit from another class
matlab.io.datastore.FoldersPropertyProviderto add support for aFoldersproperty (and thus theFolderLayoutname-value pair ofwriteall). If you do this, then you can use thepopulateFoldersFromLocationmethod in the datastore constructor to populate theFoldersproperty.To add support for the
'UseParallel'option ofwriteall, you must subclass from bothmatlab.io.datastore.FileWritableandmatlab.io.datastore.Partitionableand implement apartitionmethod in the subclass that supports the syntaxpartition(ds,'Files',index).
The matlab.io.datastore.FileWritable class is a handle class.
Properties
Methods
Examples
Version History
Introduced in R2020a