Read and write data in spreadsheet files, including
.xlsx files into tables, timetables, matrices, or arrays in MATLAB®. You can import spreadsheet data interactively using the Import Tool or you can import data programmatically using the functions listed here. You can import a selected range of data or you can import multiple worksheets from spreadsheet files.
Import Data Interactively
Read and Write Tables or Timetables
Basic Import and Export
|Create table from file|
|Write table to file|
|Create timetable from file|
|Write timetable to file|
|Get sheet names from spreadsheet file|
Define Import Rules
|Datastore for spreadsheet files|
Read Spreadsheet Data
Spreadsheets often contain a mix of numeric and text data as well as variable and row names, which is best represented in MATLAB as a table.
Preview spreadsheet data from a file or the clipboard and select data to import using the Import tool.
The best way to represent tabular spreadsheet data in MATLAB is in a table since tables can store heterogeneous (a mix of numeric and text) data, as well as variable and row names.
In addition to importing data as a table using
you can also import data as a matrix, a cell array, or import separate variables
directly in to the workspace.
Read and manage data from a collection of spreadsheet files.
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
Write Spreadsheet Data
Export data in the workspace to a Microsoft Excel spreadsheet file.