Documentation

isaUnderlying

Determine if tall array data is of specified class

Syntax

tf = isaUnderlying(X,cl)

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 = datastore('airlinesmall.csv','TreatAsMissing','NA',...'SelectedVariableNames',varnames); tt = tall(ds)
tt = M×2 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 = 1×6 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

Introduced in R2016b

Was this topic helpful?