主要内容

Tables

Arrays in tabular form whose named columns can have different types

table是适用于以列为导向或表格数据的数据类型,通常将其作为文本文件或电子表格中的列存储。表由行和面向列的变量组成。表中的每个变量都可以具有不同的数据类型和不同的大小,并且一个限制性可以具有相同数量的行。有关更多信息,请参阅创建和使用桌子or watchTables and Categorical Arrays.

Functions

expand all

table Table array with named variables that can contain different types
array2table 将同质阵列转换为表格
Cell2table Convert cell array to table
struct2table Convert structure array to table
table2array 将表转换为同质阵列
table2cell 将表转换为单元格数组
table2struct Convert table to structure array
table2timetable 将表转换为时间表
timetable2table Convert timetable to table
vartype 订阅到表或按变量类型的时间表
convertvars Convert table or timetable variables to specified data type

Basic Import and Export

readtable Create table from file
writetable Write table to file

定义导入规则

detectImportOptions 基于文件内容的创建导入选项
电子表格importoptions Import options object for Spreadsheets
getvaropts Get variable import options
setvaropts Set variable import options
setvartype Set variable data types
preview 使用导入选项从文件预览八行
获取顶部的桌子,时间表或高阵列
tail Get bottom rows of table, timetable, or tall array
summary Print summary of table, timetable, or categorical array
height Number of table rows
宽度 表变量的数量
iStable Determine whether input is table
堆栈edplot Stacked plot of several variables with common x-axis

种类

sor 种类rows of matrix or table
unique 数组中的唯一值
issortedrows Determine if matrix or table rows are sorted
topkrows Top rows in sorted order

Rearrange Variables

addvars Add variables to table or timetable
renamevars Rename variables in table or timetable
movevars Move variables in table or timetable
removevars Delete variables from table or timetable
splitvars 在表格或时间表中拆分多壁变量
合并 Combine table or timetable variables into multicolumn variable
vartype 订阅到表或按变量类型的时间表
convertvars Convert table or timetable variables to specified data type

重塑

rows2vars 重新定位表或时间表,以使行变量变量
堆栈 输入表或时间表中的堆栈数据中的一个变量或时间表中的一个变量
unstack 将单个变量的数据解开到多个变量
Inner2outer 将表或时间表中的嵌套台式台式层次结构

Customize Properties

addprop 将自定义属性添加到表或时间表
rmprop 从表或时间表中删除自定义属性

Join Using Key Variables

join 使用键变量将两个表或时间表组合到行中
innerjoin Inner join between two tables or timetables
outerjoin Outer join between two tables or timetables

Set Operations

union 设置两个阵列
intersect 设置两个阵列的交点
ismember Array elements that are members of set array
setdiff Set difference of two arrays
setxor Set exclusive OR of two arrays
ismissing Find missing values
standardizeMissing 插入标准缺失值
rmmissing Remove missing entries
fillmissing 填写缺失值
varfun Apply function to table or timetable variables
RowFun Apply function to table or timetable rows
findgroups Find groups and return group numbers
splitapply Split data into groups and apply function
群体 小组摘要计算
vartype 订阅到表或按变量类型的时间表
convertvars Convert table or timetable variables to specified data type

Live Editor Tasks

Join Tables Combine two tables using key variables in the Live Editor
堆栈表变量 将来自多个表变量的值结合到实时编辑器中的一个表变量
解开表变量 Distribute values from one table variable to multiple table variables in the Live Editor

Topics

Advantages of Using Tables

使用表方便地存储混合型数据,使用数字或索引访问数据,然后存储元数据。

创建和使用桌子

此示例显示了如何从工作区变量创建表格,使用表数据以及将表写入文件以备后用。

Access Data in Tables

Indexing into tables with parentheses, dot notation, and curly braces accesses table data in different ways. You can use indexing to create a table that is a subset of a larger table or to create an array from data in a table.

Calculations on Tables

此示例显示了如何在表上执行计算。

Changes to DimensionNames Property in R2016b

Tables can raise compatibility warnings, and change dimension names, when you modify the DimensionNames property.