Tables
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 Tables and Assign Data to Them or watch Tables and Categorical Arrays.
Functions
Apps
Data Cleaner | Preprocess and organize column-oriented data (Since R2022a) |
Live Editor Tasks
Compute by Group | Summarize, transform, or filter by group in the Live Editor (Since R2021b) |
Pivot Table | Summarize tabular data in pivoted table in the Live Editor (Since R2023b) |
Join Tables | Combine two tables using key variables in the Live Editor |
Stack Table Variables | Combine values from multiple table variables into one table variable in the Live Editor (Since R2020a) |
Unstack Table Variables | Distribute values from one table variable to multiple table variables in the Live Editor (Since R2020a) |
Topics
- Create Tables and Assign Data to Them
There are several ways to create tables and assign data to them. You can create tables from input arrays, preallocate tables and fill them in later, or import tables from text files or spreadsheets.
- Control How MATLAB Imports Your Data
If you want to control the import process beyond the options provided by the
readtable
function, such as defining how to handle missing data or errors, then create an import options object before importing the data. - 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.
- Direct Calculations on Tables and Timetables
You can perform calculations directly on tables and timetables without indexing to extract their data. All the variables in your tables and timetables must have data types that support calculations.
- Plots That Support Tables
Create plots by passing tables directly to plotting functions.
- Tables of Mixed Data
Use tables to store mixed-type data conveniently, access data with numeric or named indexing, and to store metadata.
- Changes to DimensionNames Property in R2016b
Tables can raise compatibility warnings, and change dimension names, when you modify the DimensionNames property.