Main Content

isaUnderlying

Determine if tall array data is of specified class

Description

example

tf = isaUnderlying(X,cl)returns a tall array containing logical1(true) if the underlying data in tall arrayXis of classcl. Otherwise, the tall array contains logical0(false).

Examples

collapse all

All tall tables and arrays belong to thetallclass. However, theunderlying数据type of a tall array can vary.

Create a datastore for theairlinesmall.csv数据set. Select a subset of the variables to work with, and treat'NA'values as missing data so that数据storereplaces them withNaNvalues. Convert the datastore into a tall table.

varnames = {“年”,'UniqueCarrier'}; ds = tabularTextDatastore('airlinesmall.csv','TreatAsMissing','NA',...'SelectedVariableNames',varnames); tt = tall(ds)
tt = Mx2 tall table Year UniqueCarrier ____ _____________ 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} 1987 {'PS'} : : : :

Test whether the underlying data type of the first table variableYearissingle.

tf = isaUnderlying(tt.Year,'single')
tf = tall logical 0

Determine the actual underlying data type ofYear.

udt = classUnderlying(tt.Year)
udt = 1x6 tall char array 'double'

Input Arguments

collapse all

Input array, specified as a tall array.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical|table|cell|categorical|datetime|duration|calendarDuration

Underlying class, specified as a character vector specifying any valid MATLAB®class name.

Example:tf = isaUnderlying(X,'double')

Tips

Extended Capabilities

Tall Arrays
Calculate with arrays that have more rows than fit in memory.

Introduced in R2016b