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.
Note If MATLAB does not support a high-level function that works with a data format, you can use the MATLAB low-level file I/O functions, if you know how the binary data is formatted in the file. See Using Low-Level File I/O Functions for more information. |
Data Format |
File Extension |
Description |
Audio files |
.au |
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 |
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 FunctionsFunction |
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 |
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 |