在R使用matlab

与matlab相关的包

R.matlab

简单读存mat文件,并在R中调用matlab

install.packages("R.matlab")
library(R.matlab)

实例如下

dat <- readMat(xxxx.mat)
print(dat$xx)
注意事项

读入压缩.mat文件时:

Reading compressed MAT files
From MATLAB v7, compressed MAT version 5 files are used by default [3-5], which is supported by this function.
If for some reason it fails, use save -V6 in MATLAB to write non-compressed MAT v5 files (sic!).

保存.mat文件时:

About MAT files saved in MATLAB using '-v7.3’
MAT v7.3 files, saved using for instance save(‘foo.mat’, ‘-v7.3’), stores the data in the Hierarchical Data Format (HDF5) [6, 7], which is a format not supported by this function/package. However, there exist other R packages that can parse HDF5, e.g. CRAN package h5 and Bioconductor package rhdf5.

matlabr

在R中创建MATLAB命令行或者代码,增强R.matlab包的功能

install.packages("matlabr")
library(matlabr)

matlab

install.packages("matlab")
library(matlab)

你可能感兴趣的:(R)