You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in order to speed up the compuation of python, I chose to use matlab's coder toolbox to convert matlab to c/c++ code, so as not to rely on matlab runtime.
I just recently learned
swig through coder-swig.
This package converts wrap MATLAB Coder generated C and C++ code to python code with swig.
But I found it is too complicated to use the function in the c dll file with numpy , as shown in the code example.
I have many questions about the i files about swig,Can you help me?
Firsr, the Code generation for function 'timestwo' is shown as below.
/* Function Definitions in timestwo.h*/
void timestwo(const emxArray_real_T *x, emxArray_real_T *y)
Here x is input array ,y is output array.
the emxArray is a struct is show as below.
/* Type Definitions in timestwo_types.h*/
#ifndef struct_emxArray_real_T
#define struct_emxArray_real_T
struct emxArray_real_T
{
double *data;
int *size;
int allocatedSize;
int numDimensions;
boolean_T canFreeData;
};
#endif
I have write an i file to wrap emxArray_real_T for numpy array.
It seems not work.Can you help me to check it?
Or is there a simple or clever way to convert emx array to numpy array, like convert eigen matirx to numpy wieth eigen.i file?
Hello, sir
in order to speed up the compuation of python, I chose to use matlab's coder toolbox to convert matlab to c/c++ code, so as not to rely on matlab runtime.
I just recently learned
swig through coder-swig.
This package converts wrap MATLAB Coder generated C and C++ code to python code with swig.
But I found it is too complicated to use the function in the c dll file with numpy , as shown in the code example.
I have many questions about the i files about swig,Can you help me?
Here is some code changed from the third example of the coder-swig package.
03-timestwo-dynamic-size.zip
Firsr, the Code generation for function 'timestwo' is shown as below.
Here x is input array ,y is output array.
the emxArray is a struct is show as below.
I have write an i file to wrap emxArray_real_T for numpy array.
It seems not work.Can you help me to check it?
Or is there a simple or clever way to convert emx array to numpy array, like convert eigen matirx to numpy wieth eigen.i file?
The text was updated successfully, but these errors were encountered: