%% Test Underlying Class of Tall Arrays
% All tall tables and arrays belong to the tall class. However, the underlying data type of a tall array can vary.
% Create a datastore for the airlinesmall.csv data set. Select a subset of the variables to work with, and treat 'NA' values as missing data so that datastore replaces them with NaN values. Convert the datastore into a tall table.

varnames = {'Year', 'UniqueCarrier'};
ds = tabularTextDatastore('airlinesmall.csv','TreatAsMissing','NA',...
    'SelectedVariableNames',varnames);
tt = tall(ds)

%
% Test whether the underlying data type of the first table variable Year is single.

tf = isaUnderlying(tt.Year,'single')

%
% Determine the actual underlying data type of Year.

udt = classUnderlying(tt.Year)

% Copyright 2012 The MathWorks, Inc.