Learn R Programming

R.matlab (version 3.8.0)

readMat: Reads a MAT file structure from a connection or a file

Description

Reads a MAT file structure from a connection or a file. Both the MAT version 4 and MAT version 5 file formats are supported. The implementation is based on [1-5]. Note: Do not mix up version numbers for the MATLAB software and the MATLAB file formats.

Usage

# S3 method for default
readMat(con, maxLength=NULL, fixNames=TRUE, drop=c("singletonLists"),
  sparseMatrixClass=c("Matrix", "SparseM", "matrix"), verbose=FALSE, ...)

Arguments

Value

Returns a named list structure containing all variables in the MAT file structure.

References

[1] The MathWorks Inc., MATLAB - MAT-File Format, version 5, June 1999.
[2] The MathWorks Inc., MATLAB - Application Program Interface Guide, version 5, 1998.
[3] The MathWorks Inc., MATLAB - MAT-File Format, version 7, September 2009.
[4] The MathWorks Inc., MATLAB - MAT-File Format, version R2012a, September 2012.
[5] The MathWorks Inc., MATLAB - MAT-File Format, version R2015b, September 2015.
[6] The MathWorks Inc., MATLAB - MAT-File Versions, December 2015. https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html
[7] Undocumented Matlab, Improving save performance, May 2013. https://undocumentedmatlab.com/articles/improving-save-performance/
[8] J. Gilbert et al., Sparse Matrices in MATLAB: Design and Implementation, SIAM J. Matrix Anal. Appl., 1992. https://www.mathworks.com/help/pdf_doc/otherdocs/simax.pdf
[9] J. Burkardt, HB Files: Harwell Boeing Sparse Matrix File Format, Apr 2010. https://people.sc.fsu.edu/~jburkardt/data/hb/hb.html

See Also

writeMat().

Examples

Run this code
path <- system.file("mat-files", package = "R.matlab")
pathname <- file.path(path, "ABC.mat")
data <- readMat(pathname)
print(data)

Run the code above in your browser using DataLab