Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

Importing and Exporting Data

Importing Data to the Workspace

The first step in analyzing data is to import it into the MATLAB workspace. See the topics under Importing Data for detailed information about supported data formats and the functions you can use.

The easiest way to import data is to use the MATLAB Import Wizard. With the Import Wizard, you can create variables from the following types of data sources:

The MATLAB Import Wizard processes the data source and recognizes data delimiters, as well as row or column headers, to facilitate the process of data selection. It also lets you choose which worksheets within an Excel workbook to import. Use the Import Wizard or xlsfinfo to identify names of worksheets contained in a workbook.

You can analyze data stored in scientific data formats, such as CDF, netCDF, FITS, HDF4 and HDF5. Import CDF files with cdfread, HDF4 files with hdfread and with the hdftool GUI, and HDF5 files with hdf5read. Use informational functions, such as cdfinfo, hdfinfo, and hdf5info, to determine what data these files contain before importing variables from them. For more information on using these and other scientific data formats, see Importing Scientific Data Files and the complete list of supported file formats.

You can also import time series data and generate time vectors for it. When you work with time series data, use the Time Series Tools GUI (tstool) to import the data and create timeseries objects. The Time Series Tools Import Wizard makes it easy to import or define a time vector for your data. For more information, see Time Series Tools.

Exporting Data from the Workspace

When you analyze your data, you might create new variables or modified imported variables. You can export variables from the MATLAB workspace to a variety of file formats, both character-based and binary. You can, for example, create HDF and Excel files containing your data. File formats you can export to include MAT-files, text files, spreadsheets, and several types of scientific data files. For details, see the respective topics listed in Exporting Data and the complete list of supported file formats.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS