Load part of matfile error: 'VARName' does not exist

夙愿已清 提交于 2019-12-12 04:37:56

问题


i'm trying to load part of array in a matfile like is showed in http://www.mathworks.com/help/matlab/ref/matfile.html

however, when i use loadedData = matObj.varName(indices) i keep getting: 'varName' does not exist

someone knows what's rong?


回答1:


In place of VarName you should use the name of the actual variable you want to retrieve.

Suppose you have saved a variable A into myMat:

A      = rand(10);
save('myMat','A','-v7.3')

matObj = matfile('myMat');
data   = matObj.A(1:2,2);


来源:https://stackoverflow.com/questions/16743896/load-part-of-matfile-error-varname-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!