Programming Previous page   Next Page

Text Data

In text format, the data values are American Standard Code for Information Interchange (ASCII) codes that represent alphabetic and numeric characters. ASCII text data can be viewed in a text editor. For more information about working with text data in MATLAB, see

These sections also describe how to import and export to XML documents.

Graphics Files

MATLAB imports and exports images from many standard graphics file formats, including the Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Joint Photographic Experts Group (JPEG), and Portable Network Graphics (PNG) formats.

Audio and Audio/Video Data

MATLAB provides functions to enable you to interact with the following types of audio and audio/video files:

Spreadsheets

You can use MATLAB to import and export data to the following types of spreadsheets:

Scientific Formats

Scientific data formats supported by MATLAB are

The Internet

From your MATLAB session, you can

Low-Level File I/O

MATLAB also supports C-style, low-level I/O functions that you can use with any data format. For more information, see Using Low-Level File I/O Functions.

Large Data Sets

An efficient way to read files with large data sets is to read the file in segments and process the data as you go. This method requires significantly less memory than if you were to try reading in the entire file at once. Using the textscan function, you can read a specified amount of data from a file, and maintain a pointer to the location in the file where your last read operation ended and your next read is to begin.

This example opens a large data file and reads the file a segment at a time in a for loop. The code calls textscan to read a particular pattern of data (as specified by format) 10,000 times for each segment. Following each read, the subfunction process_data processes the data collected in cell array segarray:

Toolboxes for Importing Data

In addition to MATLAB import functions, you can perform specialized import features using toolboxes. For example, use the Database Toolbox for importing data from relational databases. Refer to the documentation on the specific toolbox to see what import features are offered.


Previous page  Overview Using the Import Wizard Next page

© 1994-2005 The MathWorks, Inc.