Data Import and Analysis > Data Import and Export

83 functions in MATLAB › Data Import and Analysis > Data Import and Export.

Standard File Formats

audioinfoReads the metadata of an audio file without loading its samples.
audioreadReads an audio file into a matrix of samples and returns its sample rate.
audiowriteWrites a matrix of samples to an audio file.
closeCloses figure windows.
csvreadReads a comma-separated numeric file into a matrix.
csvwriteWrites a numeric matrix to a comma-separated file.
delimitedTextImportOptionsCreates an options object that describes how to import a delimited text file.
dlmreadReads a delimited numeric file into a matrix.
dlmwriteWrites a numeric matrix to a delimited text file.
filereadReads a whole text file into a character vector.
getReads a property of a graphics object.
imfinfoReturns information about an image file.
importdataLoads data from a file, choosing the loader by file type.
imreadReads an image file into an array.
imwriteWrites an array to an image file.
jsondecodeConverts JSON text into MATLAB values.
jsonencodeConverts MATLAB values into JSON text.
lin2muConverts linear audio samples to 8-bit mu-law.
mu2linConverts 8-bit mu-law codes back to linear audio samples.
readcellReads a spreadsheet or delimited text file into a cell array.
readlinesReads the lines of a text file into a string array.
readmatrixReads a numeric matrix from a text or spreadsheet file.
readstructReads an XML file into a scalar struct.
readvarsReads the columns of a file into separate variables.
setSets properties of a graphics object.
sheetnamesLists the sheet names of a spreadsheet file.
textreadReads formatted text-file data into separate variables.
textscanReads formatted data from a file or text into a cell array of columns.
Tiff.closeCloses the TIFF file held by a Tiff object.
Tiff.computeStripReturns the index of the strip that contains a given image row.
Tiff.computeTileReturns the index of the tile that contains a given image position.
Tiff.currentDirectoryReturns the number of the current image directory in the file.
Tiff.getTagReads the value of a TIFF tag of the current directory.
Tiff.getTagNamesReturns the names of the tags that the Tiff class supports.
Tiff.getVersionReturns the version text of the TIFF library in use.
Tiff.isTiledTells whether the current image is stored in tiles.
Tiff.lastDirectoryTells whether the current directory is the last one in the file.
Tiff.nextDirectoryMoves to the next image directory in the file.
Tiff.numberOfStripsReturns the number of strips in the current image.
Tiff.numberOfTilesReturns the number of tiles in the current image.
Tiff.readReads the whole current image into an array.
Tiff.readEncodedStripReads one strip of the current image, still as stored.
Tiff.readEncodedTileReads one tile of the current image, still as stored.
Tiff.readRGBAImageReads the whole image converted to RGB color data.
Tiff.readRGBAStripReads one strip converted to RGB color data.
Tiff.readRGBATileReads one tile converted to RGB color data.
Tiff.rewriteDirectoryUpdates the current directory of a file with changed tags.
Tiff.setDirectoryMakes a given image directory the current one.
Tiff.setSubDirectoryMoves to a sub-image whose file offset is given by a SubIFD tag.
Tiff.setTagSets the value of a TIFF tag before writing an image.
Tiff.writeMethod of a Tiff object: writes an image to the current directory of a TIFF file opened for writing.
Tiff.writeDirectoryMethod of a Tiff object: closes the current image directory and starts a new one, for multi-image TIFF files.
Tiff.writeEncodedStripMethod of a Tiff object: writes one strip of a stripped TIFF image from an array of pixels.
Tiff.writeEncodedTileMethod of a Tiff object: writes one tile of a tiled TIFF image from an array of pixels.
typeDisplays the contents of a text file in the command window.
writecellWrites a cell array to a delimited text file or spreadsheet.
writelinesWrites text lines to a file, one string per line.
writematrixWrites a numeric matrix to a delimited text file or spreadsheet.
writestructWrites a structure to an XML or JSON file.
xlsfinfoReports whether a file is a readable spreadsheet and lists its sheets.
xlsreadReads numbers and text from an Excel spreadsheet.
xlswriteWrites a matrix or cell array to an Excel spreadsheet.

Workspace Variables and MAT-Files

clearRemoves variables from the workspace.
clearvarsClears selected variables from the workspace, with options to keep some.
dispDisplays a value in the command window without printing its name.
formattedDisplayTextReturns, as a string, the text that displaying a value would print.
loadLoads variables from a MAT-file or numeric data from a text file.
matfileAccesses variables in a MAT-file without loading the whole file.
saveSaves workspace variables to a MAT-file or a text file.
whoLists the names of the variables in the current workspace.

Low-Level File I/O

fcloseCloses an open file.
feofTests whether the read position is at the end of a file.
ferrorReturns the error message and code of the last file operation.
fgetlReads one line from a file and drops the newline.
fgetsReads one line from a file and keeps the newline character.
fopenOpens a file and returns a file identifier.
fprintfWrites formatted text to the command window or to a file.
freadReads binary data from a file.
frewindMoves the read position of a file back to its beginning.
fscanfReads formatted data from a text file.
fseekMoves the file position to a given byte offset.
ftellReturns the current byte position in a file.
fwriteWrites binary data to a file.