xlsread
(Not recommended) Read spreadsheet file
xlsread is not recommended. Use readtable, readmatrix, or readcell
instead. For more information, see Compatibility
Considerations.
Syntax
Description
reads data from the spreadsheet in num = xlsread(filename,sheet,xlRange,'basic')basic import mode. If your
computer does not have Excel for Windows® or if you are using MATLAB®
Online™, xlsread automatically operates in
basic import mode, which supports XLS, XLSX, XLSM, XLTX,
and XLTM files.
If you do not specify all the arguments, use empty character vectors,
'' , as placeholders, for example, num =
xlsread(filename,'','','basic').
___ = xlsread(
opens an Excel window to interactively select data. Select the worksheet, drag
and drop the mouse over the range you want, and click OK.
This syntax is supported only on Windows computers with Microsoft
Excel software installed.filename,-1)
[,
where num,txt,raw,custom]
= xlsread(filename,sheet,xlRange,'',processFcn)processFcn is a function handle, reads from the
spreadsheet, calls processFcn on the data, and returns the
final results as numeric data in array num. The
xlsread function returns the text fields in cell array
txt, both the numeric and text data in cell array
raw, and the second output from
processFcn in array custom. The
xlsread function does not change the data stored in the
spreadsheet. This syntax is supported only on Windows computers with Excel software.
Examples
Input Arguments
Output Arguments
Limitations
xlsreadreads only 7-bit ASCII characters.xlsreaddoes not support non-contiguous ranges.If your computer does not have Excel for Windows or if you are using MATLAB Online,
xlsreadautomatically operates inbasicimport mode.On Linux® and Mac platforms,
xlsreadcannot open spreadsheet files written by thewritetablefunction.
Algorithms
xlsreadimports formatted text representing dates (such as'10/31/96'), except when importing inbasicmode.