Documentation

Supported File Formats for Import and Export

The following table shows the file formats that you can import and export from the MATLAB® application.

In addition to the functions in the table, you also can use the importdata function, or import these file formats interactively, with the following exceptions:

  • importdata and interactive import do not support H5 and netCDF files.

  • importdata does not support HDF files.

File Content

Extension

Description

Import Function

Export Function

MATLAB formatted data

MAT

Saved MATLAB workspace

load

save

Partial access of variables in MATLAB workspace

matfilematfile

Text

any, including:
CSV
TXT

Comma delimited numbers

csvread

csvwrite

Delimited numbers

dlmread

dlmwrite

Delimited numbers, or a mix of strings and numbers

textscan

none

Column-oriented delimited numbers or a mix of strings and numbers

readtable

writetable

Spreadsheet

XLS
XLSX
XLSM

XLSB (Systems with Microsoft® Excel® for Windows® only)

XLTM (import only)
XLTX (import only)

ODS (Systems with COM interface)

Worksheet or range of spreadsheet

xlsread

xlswrite

Column-oriented data in worksheet or range of spreadsheet

readtable

writetable

Extensible Markup Language

XML

XML-formatted text

xmlread

xmlwrite

Data Acquisition Toolbox™ file

DAQ

Data Acquisition Toolbox

daqread

none

Scientific data

CDF

Common Data Format

See cdflib

See cdflib

FITS

Flexible Image Transport System

See FITS Files

See FITS Files

HDF

Hierarchical Data Format, version 4, or HDF-EOS v. 2

See HDF4 Files

See HDF4 Files

H5

HDF or HDF-EOS, version 5

See HDF5 Files

See HDF5 Files

NC

Network Common Data Form (netCDF)

See netcdf

See netcdf

Image

BMP

Windows Bitmap

imread

imwrite

GIF

Graphics Interchange Format

HDF

Hierarchical Data Format

JPEG
JPG

Joint Photographic Experts Group

JP2
JPF
JPX
J2C
J2K

JPEG 2000

PBM

Portable Bitmap

PCX

Paintbrush

PGM

Portable Graymap

PNG

Portable Network Graphics

PNM

Portable Any Map

PPM

Portable Pixmap

RAS

Sun™ Raster

TIFF
TIF

Tagged Image File Format

XWD

X Window Dump

CUR

Windows Cursor resources

imread

none

FITS

FTS

Flexible Image Transport System

ICO

Windows Icon resources

Audio (all platforms)

AU
SND

NeXT/Sun sound

audioread

audiowrite

FLAC

Free Lossless Audio Codec

OGG

Ogg Vorbis

WAV

Microsoft WAVE sound

Audio (Windows)

M4A
MP4

MPEG-4

audioreadaudiowrite

any

Formats supported by Microsoft Media Foundation

audioreadnone

Audio (Mac)

M4A
MP4

MPEG-4

audioreadaudiowrite

Audio (Linux®)

any

Formats supported by GStreamer

audioreadnone

Video (all platforms)

AVI

Audio Video Interleave

VideoReader

VideoWriter

MJ2

Motion JPEG 2000

Video (Windows)

MPG

MPEG-1

VideoReadernone

ASF
ASX
WMV

Windows Media®

any

Formats supported by Microsoft DirectShow®

Video (Windows 7 or later)

MP4
M4V

MPEG-4

VideoReaderVideoWriter

MOV

QuickTime

VideoReadernone

any

Formats supported by Microsoft Media Foundation

Video (Mac)

MP4
M4V

MPEG-4

VideoReaderVideoWriter

MPG

MPEG-1

VideoReadernone

MOV

QuickTime

any

Formats supported by QuickTime, including .3gp, .3g2, and .dv

Video (Linux)

any

Formats supported by your installed GStreamer plug-ins, including .ogg

VideoReadernone

Was this topic helpful?