mxArray指针的变量名称

时间:2018-05-03 08:56:57

标签: matlab mex

是否可以获取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);

0 个答案:

没有答案
相关问题