Main Content



Compare file indices

Since R2020a


tf = currentFileIndexComparator(ds,ind)


tf = currentFileIndexComparator(ds,ind) compares the write index ind to the read index of the current file being read by the datastore. The result is a logical 1 (true) when the indices are the same, and a logical 0 (false) otherwise. This provides an indication of the number of reads per file.

If your custom datastore subclasses from, then it inherits a currentFileIndexComparator method that always returns false. If the datastore primarily works with files that require multiple reads per file, then you must implement your own getCurrentFilename and currentFileIndexComparator methods in the subclass. These methods tell the datastore which file is being read, and whether the file requires multiple reads.

Input Arguments

expand all

Input datastore, specified as a datastore object that inherits from To create a datastore object, see

Write index, specified as a positive integer scalar.



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2020a