table is a data type suitable for column-oriented
or tabular data that is often stored as columns in a text file or
in a spreadsheet. Tables consist of rows and column-oriented variables.
Each variable in a table can have a different data type and a different
size with the one restriction that each variable must have the same
number of rows. For more information, see Create and Work with Tables or
watch Tables
and Categorical Arrays.
table |
Create table from workspace variables |
array2table |
Convert homogeneous array to table |
cell2table |
Convert cell array to table |
struct2table |
Convert structure array to table |
table2array |
Convert table to homogeneous array |
table2cell |
Convert table to cell array |
table2struct |
Convert table to structure array |
readtable |
Create table from file |
writetable |
Write table to file |
detectImportOptions |
Create import options based on file content |
getvaropts |
Get variable import options |
setvaropts |
Set variable import options |
setvartype |
Set variable data types |
intersect |
Set intersection of two arrays |
ismember |
Array elements that are members of set array |
setdiff |
Set difference of two arrays |
setxor |
Set exclusive OR of two arrays |
unique |
Unique values in array |
union |
Set union of two arrays |
join |
Combine strings, or merge two tables or timetables by rows using key variables |
innerjoin |
Inner join between two tables or two timetables |
outerjoin |
Outer join between two tables or two timetables |
ismissing |
Find missing values |
standardizeMissing |
Insert standard missing-value indicators |
rmmissing |
Remove missing entries |
fillmissing |
Fill missing values |
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 |
Table Properties |
Access and modify table metadata properties |
Use tables to store mixed-type data conveniently, access data with numeric or named indexing, and to store metadata.
This example shows how to create a table from workspace variables, work with table data, and write tables to files for later use.
Indexing into tables with parentheses, curly braces, and dot notation has different results. 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.
This example shows how to perform calculation on tables.