This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Microsoft® Excel® spreadsheets

Read and write data in spreadsheet files, including .xls and .xlsx files. Import spreadsheet data interactively using the Import Tool. Import or export spreadsheet data programmatically using the functions on this page. To compare primary ways to import spreadsheet files, see Ways to Import Spreadsheets.


expand all

Import ToolImport data from file

Basic Import and Export

readtableCreate table from file
writetableWrite table to file

Define Import Rules

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
xlsfinfoDetermine if file contains Microsoft Excel spreadsheet
xlsreadRead Microsoft Excel spreadsheet file
xlswriteWrite Microsoft Excel spreadsheet file
importdataLoad data from file


spreadsheetDatastoreDatastore for spreadsheet files


Ways to Import Spreadsheets

You can import data from spreadsheet files into MATLAB® interactively using the Import Tool, programmatically using import functions, or by pasting data from the clipboard.

Write Data to Excel Spreadsheets

Export data in the workspace to a Microsoft Excel spreadsheet file.

Define Import Options for Tables

For customized data import and additional control over the import process, define and use the import options.