www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ReadAllDataInTabularTextDatastoreExample.m

    %% Read All Data in TabularTextDatastore
%%
% Create a datastore from the sample file |airlinesmall.csv|, which
% contains tabular data. 
ds = tabularTextDatastore('airlinesmall.csv','TreatAsMissing','NA');
%%
% Modify the |SelectedVariableNames| property
% to specify the variables of interest.
ds.SelectedVariableNames = {'DepTime','ArrTime','ActualElapsedTime'};
%%
% Read all the data in the datastore.
T = readall(ds);
%%
% |readall| returns all the data in a table.
%%
% View information about the table.
T.Properties
%%
% View a summary of the output table.
summary(T)