istabular
说明
如果 A
是表或时间表,则 tf = istabular(
返回逻辑值 A
)1
(true
),否则返回逻辑值 0
(false
)。
此语法等效于 tf = istable(A) || istimetable(A)
,但更方便。
示例
确定输入是表还是时间表
使用 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
函数。
tf = istabular(T)
tf = logical
1
现在将 T
转换为一个时间表。
TT = table2timetable(T,'RowTimes',hours(1:5))
TT=5×2 timetable
Time Var1 Var2
____ ____ ____
1 hr 98 120
2 hr 97.5 111
3 hr 97.9 119
4 hr 98.1 117
5 hr 101 118
对于 TT
,函数 istabular
仍返回 1
。
tf = istabular(TT)
tf = logical
1
但是,istable
函数会返回 0
,因为 TT
是时间表,而不是表。
tf = istable(TT)
tf = logical
0
输入参数
A
— 输入变量
任意数据类型
输入变量
扩展功能
tall 数组
对行数太多而无法放入内存的数组进行计算。
此函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
版本历史记录
在 R2021b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)