matlab.io.datastore.FileWritable Class
Namespace: matlab.io.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
SupportedOutputFormats
andDefaultOutputFormat
.Implement a
write
method if the datastore writes data to a custom format.Implement a
getFiles
method if the datastore does not have aFiles
property.Implement a
getFolders
method if the datastore does not have aFolders
property.The output location is validated as a string. If your datastore requires further validation, you must implement a
validateOutputLocation
method.If the datastore is meant for files that require multiple reads per file, then you must implement the methods
getCurrentFilename
andcurrentFileIndexComparator
.Optionally, inherit from another class
matlab.io.datastore.FoldersPropertyProvider
to add support for aFolders
property (and thus theFolderLayout
name-value pair ofwriteall
). If you do this, then you can use thepopulateFoldersFromLocation
method in the datastore constructor to populate theFolders
property.To add support for the
'UseParallel'
option ofwriteall
, you must subclass from bothmatlab.io.datastore.FileWritable
andmatlab.io.datastore.Partitionable
and implement apartition
method 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