是否可以获取mxArray指针的变量名?
const char * strFileMatFile = "path/to/mat/file.mat";
pMatFile = matOpen(strFile, "r");
const char * strVarName = "a" // name of a variable inside the mat file
// which I want to find with the mxArray pointer
// Get a pointer to the variable with name strVarName in the mat file
mxArray *pVariable = matGetVariable(pMatFile, strVarName);
const char * strVarNameFromPtr = mxArrayToString(pVariable);
mxArrayToString(pVariable)
返回null。是否有一个函数可以返回mxArray指针的变量名?
类似的东西:
const char * strVarNameFromPtr = mxGetName(pVariable);