Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Tables

Arrays in tabular form whose named columns can have different types

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.

Functions

tableTable array with named variables that can contain different types
array2tableConvert homogeneous array to table
cell2tableConvert cell array to table
struct2tableConvert structure array to table
table2arrayConvert table to homogeneous array
table2cellConvert table to cell array
table2structConvert table to structure array

Basic Import and Export

readtableCreate table from file
writetableWrite table to file

Defining Import Rules

detectImportOptionsCreate import options based on file content
getvaroptsGet variable import options
setvaroptsSet variable import options
setvartypeSet variable data types
istableDetermine whether input is table
headGet top rows of table, timetable, or tall array
tailGet bottom rows of table, timetable, or tall array
heightNumber of table rows
widthNumber of table variables
summaryPrint summary of table, timetable, or categorical array
intersectSet intersection of two arrays
ismemberArray elements that are members of set array
setdiffSet difference of two arrays
setxorSet exclusive OR of two arrays
uniqueUnique values in array
unionSet union of two arrays
joinCombine two tables or timetables by rows using key variables
innerjoinInner join between two tables or timetables
outerjoinOuter join between two tables or timetables
sortrowsSort rows of matrix or table
issortedrowsDetermine if matrix or table rows are sorted
topkrowsTop rows in sorted order
stackStack data from multiple variables into single variable
unstackUnstack data from single variable into multiple variables
vartypeSubscript into table or timetable by variable type
ismissingFind missing values
standardizeMissingInsert standard missing values
rmmissingRemove missing entries
fillmissingFill missing values
varfunApply function to table or timetable variables
rowfunApply function to table or timetable rows
findgroupsFind groups and return group numbers
splitapplySplit data into groups and apply function

Topics

Advantages of Using Tables

Use tables to store mixed-type data conveniently, access data with numeric or named indexing, and to store metadata.

Create and Work with Tables

This example shows how to create a table from workspace variables, work with table data, and write tables to files for later use.

Access Data in a Table

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.

Calculations on Tables

This example shows how to perform calculation on tables.

Was this topic helpful?