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
import options for spreadsheet files, see Ways to Import Spreadsheets.
readtable |
Create table from file |
detectImportOptions |
Create import options based on file content |
writetable |
Write table to file |
xlsfinfo |
Determine if file contains Microsoft Excel spreadsheet |
xlsread |
Read Microsoft Excel spreadsheet file |
xlswrite |
Write Microsoft Excel spreadsheet file |
importdata |
Load data from file |
SpreadsheetImportOptions |
Import options object for Spreadsheets |
Select Spreadsheet Data Using Import Tool
This example shows how to import data from a spreadsheet into the workspace with the Import Tool.
This example shows how to import mixed numeric
and text data from a spreadsheet into a table, using the readtable
function.
Import All Worksheets from a File
This example shows how to import worksheets
in an Excel file that contains only numeric data (no row or column
headers, and no inner cells with text) into a structure array, using
the importdata
function.
Import and Export Dates to Excel Files
Microsoft Excel software can represent dates as text or numeric values.
This example shows how to export a numeric
array and a cell array to a Microsoft Excel spreadsheet file,
using the xlswrite
function.
Import or Export a Sequence of Files
To import or export multiple files, create a control loop to process one file at a time.
Define Import Options for Tables
Typically, you can import tables using the readtable
function.
You can import data from spreadsheet files into MATLAB® interactively, using the Import Tool, or programmatically, using an import function.
System Requirements for Importing Spreadsheets
If your system has Excel for Windows® installed, including the COM server (part of the typical installation of Excel):