Main Content

Data Import and Export

Move data into and out of MATLAB®

MATLAB provides several import and export functions to help you move data into and out of the MATLAB workspace. For a table of supported file formats and their associated import and export functions, see Supported File Formats for Import and Export. Alternatively, if you prefer importing data interactively, you can use the Import Tool.

Statistics and Machine Learning Toolbox™ also provides functions for importing and exporting data, listed below.


casereadRead case names from file
casewriteWrite case names to file
tblreadRead tabular data from file
tblwriteWrite tabular data to file
tdfreadRead tab-delimited file
xptreadCreate table from data stored in SAS XPORT format file


  • Sample Data Sets

    Data sets contain individual data variables, description variables with references, and dataset arrays encapsulating the data set and its description, as appropriate.