www.gusucode.com > datastoreio工具箱 matlab源码程序 > datastoreio/+matlab/+io/+datastore/@TallDatastore/readall.m

    function data = readall(tds)
%READALL Read all of the datas rows from an TallDatastore.
%   T = READALL(TDS) reads all of the data rows from TDS.
%
%   See also matlab.io.datastore.TallDatastore, hasdata, read, preview, reset

%   Copyright 2016 The MathWorks, Inc.

try
    if isEmptyFiles(tds)
        data = getZeroFirstDimData(tds);
        return;
    end
    % reset the datastore to the beginning
    % reset also errors when files are deleted between save-load of the datastore
    % to/from MAT-Files (and between releases).
    reset(tds);
    % on exit reset the datastore
    c = onCleanup(@()reset(tds));
    % read all the data
    data = readAllSplits(tds.Splitter);
    % Get only the values
    data = vertcat(data.Value{:});
catch ME
    throw(ME);
end
end