This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

hasdata (MDFDatastore)

Determine if data is available to read from MDF datastore


tf = hasdata(mdfds)



tf = hasdata(mdfds) returns logical 1 (true) if there is data available to read from the MDF datastore specified by mdfds. Otherwise, it returns logical 0 (false).


collapse all

Use hasdata in a loop to control read iterations.

mdfds = mdfDatastore(fullfile(matlabroot,'examples','vnt','CANape.MF4'));
while hasdata(mdfds)
    m = read(mdfds);

Input Arguments

collapse all

MDF datastore, specified as an MDF datastore object.

Example: mdfds = mdfDatastore('CANape.MF4')

Output Arguments

collapse all

Indicator of data to read, returned as a logical 1 (true) or 0 (false).

See Also


Introduced in R2017b