Import Tool
Import data from file
Description
The Import Tool is an interactive tool for previewing, selecting, and importing data from a wide range of file types. You can import data into the MATLAB® workspace from text files, spreadsheets, MAT files, media (image, audio, and video) files, and scientific data (HDF5 and netCDF) files, without writing code.
Using this tool, you can:
Preview data to import from a file.
Select the rows, columns, or variables to import.
Customize import options, such as specifying the name and type for an imported variable or specifying the delimiter for the import process.
Replace or exclude unimportable or empty cells.
Explore the structure of HDF5 and netCDF files.
Generate reusable MATLAB code or functions to automate importing data from similar files.
Open the Import Tool
MATLAB Toolstrip: On the Home tab, in the Variable section, click Import Data.
MATLAB command prompt: Enter
uiimportoruiimport(filename), wherefilenameis a string scalar or character vector specifying the name of a file.
Examples
Programmatic Use
Limitations
The Import Tool does not support importing data from HDF5 files that use the Family driver, the Multi driver, or the Split driver. To import data from a file that uses one of these three drivers, use either the MATLAB high-level HDF5 functions (for example,
h5readorh5readatt) or the MATLAB low-level HDF5 functions.
Tips
To interactively select and import a file within a function, use the
uiimportfunction with an output argument to open the Import Tool. This imports the data into the function workspace, rather than importing the data into the base workspace.



