Development Environment    

Exporting Binary Data

To export binary data in one of the standard binary formats, you can use the MATLAB high-level function designed to work with that format.

To find the function designed to work with a particular binary data format, scan the data formats listed in Table 6-7. The table lists the binary formats and the MATLAB high-level functions you use to import them, with pointers to sources of additional information.

Table 6-7: Binary Data Formats and MATLAB Export Functions

Data Format
File Extension
Description
Audio files
.au
.wav

Use the auwrite function to export audio files on Sun Microsystems platforms and the wavwrite function to export audio files in Microsoft Windows format.
Audio Video Interleaved (AVI)
.avi
You must use the avifile, addframe, and the close function overloaded for AVI data to export a sequence of MATLAB figures in AVI format. See Exporting MATLAB Graphs in AVI Format for more information.
Band Interleaved
No standard file extension
Use the multibandwrite function.
Common Data Format (CDF)
.cdf
To export image data in CDF format, use cdfwrite.
Hierarchical Data Format (HDF)
.hdf
To export image data in HDF format, use imwrite. For all other HDF formats, see Exporting MATLAB Data in an HDF File for complete information.
Image files
.bmp
.gif
.hdf
.jpg (.jpeg)
.pbm
.pcx
.pgm
.png
.pnm
.ppm
.ras
.tif (.tiff)
.xwd

Use the imwrite function to export image data in many different formats.
MATLAB proprietary format (MAT-files)
.mat
Use the save command to export data in MATLAB proprietary format. See Saving the Current Workspace for more information.
Spreadsheets
.wk1
Use the wk1write function to export data in Lotus 123 format.

To view the alphabetical list of MATLAB binary data export functions, see Table 6-8.

Table 6-8: Binary Data Export Functions

Function
File Extension
Data Format
auwrite
.au
Export sound data in Sun Microsystems format.
avifile
.avi
Export audio-visual data in AVI format. Creates an AVI file object. See Exporting MATLAB Graphs in AVI Format for more information.
cdfwrite
.cdf
Export data as a Common Data Format file.
hdf
.hdf
Export data in Hierarchical Data Format (HDF). For HDF image file formats, use imwrite. For all other HDF files, see Exporting MATLAB Data in an HDF File for complete information.
imwrite
.bmp
.hdf
.jpg (jpeg)
.pbm
.pcx
.pgm
.png
.pnm
.ppm
.ras
.tif (.tiff) .xwd

Export image files in many formats.
multibandwrite
No standard file extension
Export band interleaved data.
save
.mat
Export MATLAB variables in MAT-file format.
wavwrite
.wav
Export sound data on Microsoft Windows platforms.
wk1write
.wk1
Export data in Lotus 123 spreadsheet format.

  Using Import Functions with Binary Data Exporting MATLAB Graphs in AVI Format