%% Select Variables to Read
% Create a datastore from the sample file airlinesmall.csv, which contains tabular data.

ds = tabularTextDatastore('airlinesmall.csv','TreatAsMissing','NA',...
    'MissingValue',0);

%
% View the variables in the datastore.

ds.VariableNames

%
% Modify the SelectedVariableNames property to specify the variables of interest.

ds.SelectedVariableNames = {'Year','Month','Cancelled'};

%
% Alternatively, you can specify the variables of interest when you create the datastore.

ds = tabularTextDatastore('airlinesmall.csv','TreatAsMissing','NA',...
    'MissingValue',0,'SelectedVariableNames',{'Year','Month','Cancelled'});

% Copyright 2012 The MathWorks, Inc.