Main Content

hasdata

Determine if data is available to read

Description

example

tf = hasdata(ds)returns logical1(true) if there is data available to read from the datastore specified byds. Otherwise, it returns logical0(false).

Examples

collapse all

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

ds = datastore('mapredout.mat');

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

whilehasdata(ds) T = read(ds);end

Input Arguments

collapse all

Input datastore. You can use these datastores as input to thehasdatamethod.

Extended Capabilities

Version History

Introduced in R2014b

See Also