Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用R加载.mat文件时出错_R_Matlab - Fatal编程技术网

使用R加载.mat文件时出错

使用R加载.mat文件时出错,r,matlab,R,Matlab,我尝试使用R.matlab库加载.mat文件。当我跑步时: x <- readMat("MPL.mat") 有谁经历过这种情况,并且有办法处理这种情况 我对这篇文章很熟悉:但是替代方法对我不起作用…问题在于如何保存你的“MPL.mat”。如果默认情况下在MATLAB中保存,则在R中使用R.MATLAB可能无法工作 save('MPL.mat','A', 'B', '-v7') 当我在'-v7'或'-v6'中保存.mat对象时,我没有遇到问题,但R.matlab文档建议保存在'-v6'

我尝试使用R.matlab库加载.mat文件。当我跑步时:

 x <- readMat("MPL.mat")
有谁经历过这种情况,并且有办法处理这种情况


我对这篇文章很熟悉:但是替代方法对我不起作用…

问题在于如何保存你的“MPL.mat”。如果默认情况下在MATLAB中保存,则在R中使用R.MATLAB可能无法工作

save('MPL.mat','A', 'B', '-v7')
当我在'-v7''-v6'中保存.mat对象时,我没有遇到问题,但R.matlab文档建议保存在'-v6'(第25页中)。例如,我在'MPL.mat'中保存了两个矩阵(A和B)

save('MPL.mat','A', 'B', '-v7')
我可以用R读到:

require(R.matlab)
data <- readMat("MPL.mat")
View(data$A)
View(data$B)
require(R.matlab)

数据保存时使用了什么mat版本?