Why does LIBFUNCTIONS not display more than 8 return arguments in MATLAB 7.6 (R2008a)?

1 view (last 30 days)
I have the following two function declarations in my header file:
// 8 pointer argument function
__declspec(dllexport)double myfun8(double *a, double *b, double *c, double *d, double *e, double *f, double *g,double* h);
//9 pointer argument function
__declspec(dllexport)double myfun9(double *a, double *b, double *c, double *d, double *e, double *f, double *g, double * h, double *i);
I create a DLL using Visual C++ 2005 express edition and load it into MATLAB using the LOADLIBRARY function. However, when I inspect the imported function using the function: LIBFUNCTIONS, the function signatures are not consistent:
[ doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr] myfun8(doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr)
double myfun9(doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr, doublePtr)
The function with 9 output arguments is shown to have only one output argument.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is a limitation of the METHODS, METHODSVIEW, LIBFUNCTIONS, and LIBFUNCTIONVIEW functions in MATLAB release version up to and including MATLAB 7.6 (R2008a). METHODS -full does not list more then 8 output arguments and displays only the first output. Note that the function can still be called correctly and all outputs are returned.
A workaround to view the full function signature is to use the following:
libpkg=findpackage('lib');
class=findclass(libpkg,'fifteenArgDLL');
methods=class.methods;
The "method" variable would then contain information about the library:
%Sample invocation:
>> get(methods(1))
Name: 'myfun'
Description: 'myfun'
Signature: [1x1 schema.signature]
Static: 'on'
FirstArgDispatch: 'on'
>> get(methods(1).Signature)
InputTypes: {16x1 cell}
OutputTypes: {17x1 cell}
Varargout: 'off'
Varargin: 'off'
>> methods(1).Signature.OutputTypes
ans =
'double'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'
'doublePtr'

More Answers (0)

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!