MATLAB 帮助中心
确定输入是表还是时间表
自 R2021b 起
tf = istabular(A)
如果 A 是表或时间表,则 tf = istabular(A) 返回逻辑值 1 (true),否则返回逻辑值 0 (false)。
A
tf
1
true
0
false
此语法等效于 tf = istable(A) || istimetable(A),但更方便。
tf = istable(A) || istimetable(A)
全部折叠
使用 table 函数创建一个表。
table
T = table([98;97.5;97.9;98.1;101],[120;111;119;117;118])
T=5×2 table Var1 Var2 ____ ____ 98 120 97.5 111 97.9 119 98.1 117 101 118
要确认 T 是表还是时间表,请使用 istabular 函数。
T
istabular
tf = istabular(T)
tf = logical 1
现在将 T 转换为一个时间表。
TT = table2timetable(T,RowTimes=seconds(1:5))
TT=5×2 timetable Time Var1 Var2 _____ ____ ____ 1 sec 98 120 2 sec 97.5 111 3 sec 97.9 119 4 sec 98.1 117 5 sec 101 118
对于 TT,函数 istabular 仍返回 1。
TT
tf = istabular(TT)
但是,istable 函数会返回 0,因为 TT 是时间表,而不是表。
istable
tf = istable(TT)
tf = logical 0
输入数组。
True 或 false 结果,以数据类型 logical 为 1 或 0 形式返回。
logical
全部展开
istabular 函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
在 R2021b 中推出
table | timetable | iscell | isstruct | isnumeric | isobject | islogical | istable | istimetable
timetable
iscell
isstruct
isnumeric
isobject
islogical
istimetable
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处