Tables - MATLAB & Simulink (original) (raw)

Main Content

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 Tables and Assign Data to Them or watch Tables and Categorical Arrays.

Functions

expand all

Basic Import and Export

Define Import Rules

Parquet Files

summary Data summary
height Number of table rows
width Number of table variables
istable Determine if input is table
istabular Determine if input is table or timetable (Since R2021b)
head Get top rows of array or table
tail Get bottom rows of array or table
stackedplot Stacked plot of several variables with common x-axis

Sort

Filter Rows and Variables

rowfilter Selectively import rows of interest (Since R2022a)
vartype Subscript into table or timetable by variable type

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 Split multicolumn variables in table or timetable
mergevars Combine table or timetable variables into multicolumn variable
convertvars Convert table or timetable variables to specified data type

Reshape

rows2vars Reorient table or timetable so that rows become variables
stack Stack data from input table or timetable into one variable of output table or timetable
unstack Unstack data from input table or timetable into multiple variables of output table or timetable
inner2outer Invert nested table-in-table hierarchy in tables or timetables

Customize Properties

addprop Add custom properties to table or timetable
rmprop Remove custom properties from table or timetable

Join Using Key Variables

join Combine two tables or timetables by rows using key variables
innerjoin Inner join between two tables or timetables
outerjoin Outer join between two tables or timetables

Set Operations

union Union of two sets of data
intersect Intersection of two sets of data
ismember Find set members of data
setdiff Difference of two sets of data
setxor Exclusive OR of two sets of data

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
Unstack Table Variables Distribute values from one table variable to multiple table variables in the Live Editor

Topics