Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

Tablas

Arreglos en formato tabular cuyas columnas designadas pueden tener diferentes tipos de datos.

Una table (tabla) es un tipo de dato adecuado para datos orientados a columnas o datos tabulares que suelen almacenarse como columnas en un archivo de texto o en una hoja de cálculo. Las tablas constan de filas y variables orientadas a columnas. Cada variable en una tabla puede tener un tipo de datos y un tamaño diferente, con la única restricción de que cada variable debe tener la misma cantidad de filas. Para obtener más información, consulte Create and Work with Tables o vea Tablas y arreglos categóricos.

Funciones

expandir todo

tableArray de tabla con variables con nombre que pueden contener diferentes tipos
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
table2timetableConvert table to timetable
timetable2tableConvert timetable to table

Importación y exportación básicas

readtableCreate table from file
writetableWrite table to file

Definir reglas de importación

detectImportOptionsCreate import options based on file content
spreadsheetImportOptionsImport options object for Spreadsheets
getvaroptsGet variable import options
setvaroptsSet variable import options
setvartypeSet variable data types
previewPreview eight rows from file using import options
headGet top rows of table, timetable, or tall array
tailGet bottom rows of table, timetable, or tall array
summaryPrint summary of table, timetable, or categorical array
heightNumber of table rows
widthNumber of table variables
istableDetermine whether input is table
stackedplotStacked plot of several variables with common x-axis

Ordenar

sortrowsSort rows of matrix or table
uniqueValores únicos en array
issortedrowsDetermine if matrix or table rows are sorted
topkrowsTop rows in sorted order

Reorganizar variables

addvarsAdd variables to table or timetable
renamevarsRename variables in table or timetable
movevarsMove variables in table or timetable
removevarsDelete variables from table or timetable
convertvarsConvert table or timetable variables to specified data type
splitvarsSplit multicolumn variables in table or timetable
mergevarsCombine table or timetable variables into multicolumn variable
vartypeSubscript into table or timetable by variable type

Remodelar

rows2varsReorient table or timetable so that rows become variables
stackStack data from multiple variables into single variable
unstackUnstack data from single variable into multiple variables
inner2outerInvert nested table-in-table hierarchy in tables or timetables

Personalizar propiedades

addpropAdd custom properties to table or timetable
rmpropRemove custom properties from table or timetable

Combinar usando variables clave

joinCombine two tables or timetables by rows using key variables
innerjoinInner join between two tables or timetables
outerjoinOuter join between two tables or timetables

Operaciones con conjuntos

unionSet union of two arrays
intersectSet intersection of two arrays
ismemberArray elements that are members of set array
setdiffSet difference of two arrays
setxorSet exclusive OR of two arrays
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
groupsummaryGroup summary computations

Tareas de Live Editor

Join TablesCombine two tables using key variables in the Live Editor
Stack Table VariablesCombine values from multiple table variables into one table variable in the Live Editor
Unstack Table VariablesDistribute values from one table variable to multiple table variables in the Live Editor

Temas

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 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

This example shows how to perform calculation on tables.

Changes to DimensionNames Property in R2016b

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