C++ MATLAB mex函数中的索引对象数组
我试图通过mex函数访问MATLAB对象数组的元素,但我不知道如何通过mex函数中的索引访问MATLAB对象数组的单个元素 例如:C++ MATLAB mex函数中的索引对象数组,c++,matlab,indexing,mex,C++,Matlab,Indexing,Mex,我试图通过mex函数访问MATLAB对象数组的元素,但我不知道如何通过mex函数中的索引访问MATLAB对象数组的单个元素 例如: mxArray *outputValue; % some outputvalue from method "getSomeValue" mxArray *ObjectArray = ...; % Array of MATLAB-objects mwSize index = 2; % indexing does not work this wa
mxArray *outputValue; % some outputvalue from method "getSomeValue"
mxArray *ObjectArray = ...; % Array of MATLAB-objects
mwSize index = 2;
% indexing does not work this way!!!
mexCallMATLAB(1, &outputValue, 1, &ObjectArray[index], "getSomeValue");
你对如何使这个索引工作有什么建议吗?谢谢。这取决于
ObjectArray
包含的内容。ObjectArray包含许多对象,这些对象具有方法和属性。MATLAb语法看起来像outputValue=ObjectArray[7]。getSomeValue
mexCallMATLAB
需要一个mxArray*
作为第四个输入。最有可能的ObjectArray[index]
是mxArray
s(注意缺少&
)。但是,我们不知道。