marctangelder
Computer
- May 13, 2002
- 1
I want to make a dll for a VB program. The c-code below shows wrapper file with variables a and b. What code I have to build if I use matrixes instead of doubles?!?
#include "eigenwaardelib.h"
#include "matlab.h"
double __stdcall eigenwaardewrap(double a, double b)
{
mxArray *a_ptr;
mxArray *b_ptr;
mxArray *y_ptr;
double *y;
double ret;
/* Create an mxArray to input into mlfeigenwaarde */
a_ptr = mlfScalar(a);
b_ptr = mlfScalar(b);
eigenwaardelibInitialize();
y_ptr = mlfEigenwaarde(a_ptr, b_ptr);
/* The return value from mlfeigenwaarde is an mxArray so we must extract the data from it */
y = mxGetPr(y_ptr);
ret = *y;
/* Return a double precision number to Visual Basic */
return(ret);
}
#include "eigenwaardelib.h"
#include "matlab.h"
double __stdcall eigenwaardewrap(double a, double b)
{
mxArray *a_ptr;
mxArray *b_ptr;
mxArray *y_ptr;
double *y;
double ret;
/* Create an mxArray to input into mlfeigenwaarde */
a_ptr = mlfScalar(a);
b_ptr = mlfScalar(b);
eigenwaardelibInitialize();
y_ptr = mlfEigenwaarde(a_ptr, b_ptr);
/* The return value from mlfeigenwaarde is an mxArray so we must extract the data from it */
y = mxGetPr(y_ptr);
ret = *y;
/* Return a double precision number to Visual Basic */
return(ret);
}