Arrays in Tabellenform, deren benannte Spalten unterschiedliche Typen aufweisen können
table
ist ein Datentyp, der für spaltenorientierte oder tabellarische Daten geeignet ist. Diese werden oft als Spalten in einer Textdatei oder Kalkulationstabelle gespeichert. Die Tabellen bestehen aus Zeilen und spaltenorientierten Variablen. Jede Variable in einer Tabelle kann einen unterschiedlichen Datentyp und eine andere Größe aufweisen, wobei eine Einschränkung zu beachten ist: Jede Variable muss dieselbe Zeilenanzahl besitzen. Weitere Informationen finden Sie unter Create Tables and Assign Data to Them oder sehen Sie sich Tabellen und Kategorie-Arrays an.
Funktionen
alle erweitern
Erstellen von Tabellen und Konvertieren des Typs
table | Table array with named variables that can contain different types |
array2table | Convert hom*ogeneous array to table |
cell2table | Convert cell array to table |
struct2table | Convert structure array to table |
table2array | Convert table to hom*ogeneous array |
table2cell | Convert table to cell array |
table2struct | Convert table to structure array |
table2timetable | Convert table to timetable |
timetable2table | Convert timetable to table |
vartype | Subscript into table or timetable by variable type |
convertvars | Convert table or timetable variables to specified data type |
Lesen und Schreiben in Dateien
Basisfunktionen für Import und Export
readtable | Create table from file |
writetable | Write table to file |
Definieren von Importregeln
detectImportOptions | Create import options based on file content |
spreadsheetImportOptions | Import options object for Spreadsheets |
getvaropts | Get variable import options |
setvaropts | Set variable import options |
setvartype | Set variable data types |
preview | Preview eight rows from file using import options |
Parquet-Dateien
parquetread | Read columnar data from a Parquet file |
parquetwrite | Write columnar data to Parquet file |
parquetinfo | Get information about Parquet file |
Zusammenfassende Informationen und Stapeldiagramm
summary | Print summary of table, timetable, or categorical array |
height | Number of table rows |
width | Number of table variables |
istable | Determine if input is table |
istabular | Determine if input is table or timetable (Seit 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 |
Sortieren, Filtern und Umsortieren
Sortieren
sortrows | Sort rows of matrix or table |
unique | Unique values in array |
issortedrows | Determine if matrix or table rows are sorted |
topkrows | Top rows in sorted order |
Filtern von Zeilen und Variablen
rowfilter | Selectively import rows of interest (Seit R2022a) |
vartype | Subscript into table or timetable by variable type |
Umsortieren von Variablen
addvars | Add variables to table or timetable |
renamevars | Rename variables in table or timetable (Seit R2020a) |
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 |
Umformen
rows2vars | Reorient table or timetable so that rows become variables |
stack | Stack data from input table or timetable into one variable in output table or timetable |
unstack | Unstack data from one variable into multiple variables |
inner2outer | Invert nested table-in-table hierarchy in tables or timetables |
Benutzerdefinierte Eigenschaften
addprop | Add custom properties to table or timetable |
rmprop | Remove custom properties from table or timetable |
Verbindungs- und Mengen-Operationen
Verbinden mithilfe von Schlüsselvariablen
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 |
Mengen-Operationen
union | Set union of two arrays |
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 |
Fehlende Werte
anymissing | Determine if any array element is missing (Seit R2022a) |
ismissing | Find missing values |
standardizeMissing | Insert standard missing values |
rmmissing | Remove missing entries |
fillmissing | Fill missing entries |
Anwenden von Funktionen auf Tabelleninhalte
pivot | Summarize tabular data in pivoted table (Seit R2023a) |
groupcounts | Number of group elements |
groupfilter | Filter by group (Seit R2019b) |
groupsummary | Group summary computations |
grouptransform | Transform by group |
findgroups | Find groups and return group numbers |
splitapply | Split data into groups and apply function |
rowfun | Apply function to table or timetable rows |
varfun | Apply function to table or timetable variables |
vartype | Subscript into table or timetable by variable type |
convertvars | Convert table or timetable variables to specified data type |
Apps
Data Cleaner | Preprocess and organize column-oriented data (Seit R2022a) |
Live Editor Tasks
Berechnen nach Gruppe | Summarize, transform, or filter by group in the Live Editor (Seit R2021b) |
Pivot-Tabelle | Summarize tabular data in pivoted table in the Live Editor (Seit R2023b) |
Zusammenführen von Tabellen | Combine two tables using key variables in the Live Editor (Seit R2019b) |
Stapeln von Tabellenvariablen | Combine values from multiple table variables into one table variable in the Live Editor (Seit R2020a) |
Entstapeln von Tabellenvariablen | Distribute values from one table variable to multiple table variables in the Live Editor (Seit R2020a) |
Themen
- 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.
- Rename and Describe Table Variables
- Add, Delete, and Rearrange Table Variables
- Add and Delete Table Rows
- Clean Messy and Missing Data in Tables
- Using Row Labels in Table and Timetable Operations
- Convert Text in Table Variables to Categorical
- Add Custom Properties to Tables and Timetables
- 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.
- Calculations When Tables Have Both Numeric and Nonnumeric Data
- Summarize or Pivot Data in Tables Using Groups
- Perform Calculations by Group in Table
- Rules for Table and Timetable Mathematics
- 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 changedimension names, when you modify the DimensionNames property.
Enthaltene Beispiele
Live Script öffnen
Live Script öffnen
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Contact your local office