数据类型标识
确定变量的数据类型
MATLAB® 有许多函数可识别变量的数据类型或确定变量是否具有特定的数据类型。当调用或编写的代码依赖于具有特定数据类型的变量时,应使用这些函数。
函数
数值数据类型
日期和时间
isdatetime | 确定输入是否为日期时间数组 |
isduration | 确定输入是否为持续时间数组 |
iscalendarduration | 确定输入是否为日历持续时间数组 |
元胞、结构体和表
iscell | 确定输入是否为元胞数组 |
isstruct | 确定输入是否为结构体数组 |
istable | 确定输入是否为表 |
istimetable | 确定输入是否为时间表 |
istabular | 确定输入是表还是时间表 |
其他类型
is* | 检测状态 |
isa | 确定输入是否具有指定数据类型 |
iscategorical | 确定输入是否为分类数组 |
isenum | 确定变量是否为枚举 |
isgraphics | 对有效的图形对象句柄为 True |
isjava | 确定输入是否为 Java 对象 |
isobject | 确定输入是否为 MATLAB 对象 |
有关变量的信息
whos | 列出工作区中的变量及大小和类型 |
class | 对象的类 |
underlyingType | 确定数组行为的基础数据的类型 |
isUnderlyingType | 确定输入是否有指定的基础数据类型 |
validateattributes | 检查数组的有效性 |
主题
- MATLAB 基础类
您可以在 MATLAB 中使用许多不同的数据类型或类。您可以构建浮点和整数数据、字符和字符串以及逻辑
true
和false
值等构成的矩阵与数组。函数句柄可将您的代码与任何 MATLAB 函数连接在一起,而与当前范围无关。表、时间表、结构体和元胞数组提供了一种将不同类型的数据存储在同一容器中的方法。
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)