Accessing an mxarray when using codeGen to convert Matlab DLL to mex

3 ビュー (過去 30 日間)
Ajay Kumar
Ajay Kumar 2016 年 3 月 15 日
編集済み: Ajay Kumar 2016 年 3 月 18 日
Hello!
I have a *.DLL that performs some data modification on a vector:
calllib( 'DLL64', 'CPP', pX, pY)
Where pX and pY are pointers to the input and output respectively.
In order to grab the data from pY, I had initially used:
for n = 0:outLen-1
pYn = pY + n;
outVal(1+n, 1) = pYn.value;
end
When I run this through the codeGen, I had an issue with pointer increment:
??? Integers can only be combined with integers of the same class, or scalar doubles.
Turns out that pX is a mxArray. I am certain that I am reading this incorrectly. But, gave it a shot anyway:
I added a coder.extrinsic
coder.extrinsic('mxGetData');
Then I attempted to collect the data as follows:
if coder.target('MATLAB')
for n=0:outLen-1
pYn = pY + n;
outVal(1+n, 1) = pYn.value;
end
else
outVal = zeros(outLen-1, 1);
outVal = mxGetData(pY);
end
Is there any way I could increment the pointer without offending the codeGen?
It errors during codeGen. Any help is appreciated! Thank you!

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Code Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by