MATLAB 帮助中心
tall 数组中基础数据的类
C = classUnderlying(X)
C = classUnderlying(X) 返回 tall 数组 X 内存储的数据的类。
C
X
示例
全部折叠
所有 tall 表和数组都属于 tall 类。不过,tall 数组的基础数据类型可以不同。
tall
为 airlinesmall.csv 数据集创建数据存储。选择要使用的变量的子集,并将 'NA' 值视为缺失数据,以便 datastore 将它们替换为 NaN 值。将数据存储转换为 tall 表。
airlinesmall.csv
'NA'
datastore
NaN
varnames = {'Year', 'UniqueCarrier'}; ds = tabularTextDatastore('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'} : : : :
确定 tall 表 tt 和第一个表变量 Year 的类。
tt
Year
class(tt)
ans = 'tall'
class(tt.Year)
确定 tt 以及 Year 和 UniqueCarrier 表变量的基础数据类型。
UniqueCarrier
classUnderlying(tt)
ans = 1×5 tall char array 'table'
classUnderlying(tt.Year)
ans = 1×6 tall char array 'double'
classUnderlying(tt.UniqueCarrier)
ans = 1×4 tall char array 'cell'
有些情况下,classUnderlying 返回的结果是未计算的 tall 数组。可使用 gather 函数将结果加载到内存中来计算未计算的 tall 数组。
classUnderlying
gather
输入数组,指定为 tall 数组。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | table | cell | categorical | datetime | duration | calendarDuration
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
table
cell
categorical
datetime
duration
calendarDuration
基础类,以 tall 数组形式返回。
使用 isaUnderlying 可测试 tall 数组是否具有特定的基础数据类型。
isaUnderlying
全部展开
classUnderlying 函数支持 GPU 数组输入,但有以下用法说明和限制:
请参阅 classUnderlying (Parallel Computing Toolbox)。
在 R2016b 中推出
tall | isaUnderlying | istall
istall
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处