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

3 Ansichten (letzte 30 Tage)
Ajay Kumar
Ajay Kumar am 15 Mär. 2016
Bearbeitet: Ajay Kumar am 18 Mär. 2016
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!

Antworten (0)

Kategorien

Mehr zu MATLAB Code Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by