Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

hasdata

Determine if data is available to read

Syntax

tf = hasdata(ds)

Description

example

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

Examples

collapse all

Create a datastore from the sample file, mapredout.mat, which is the output file of the mapreduce function.

ds = datastore('mapredout.mat');

While there is data available in the datastore, read the data.

while hasdata(ds)
    T = read(ds);
end

Input Arguments

collapse all

Input datastore. You can use the datastore function to create a datastore object from your data.

See Also

Introduced in R2014b

Was this topic helpful?