hello, i want to import Matlab C code generation files and use it in Eclipse as an embedded code (Android NDK).
is it possible to do that?
im not very familiar with C/C++ programming but here's a code from Matlab C file:
#include "rt_nonfinite.h"
#include "test.h"
#include "filter.h"
static emlrtRSInfo h_emlrtRSI = { 182, "filter",
"C:/Program Files/MATLAB/R2012b/toolbox/eml/lib/matlab/datafun/filter.m" };
static emlrtRSInfo i_emlrtRSI = { 42, "eml_xaxpy",
"C:/Program Files/MATLAB/R2012b/toolbox/eml/lib/matlab/eml/blas/eml_xaxpy.m" };
static emlrtRSInfo j_emlrtRSI = { 25, "eml_blas_xaxpy",
"C:/Program Files/MATLAB/R2012b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xaxpy.m"
};
static emlrtRSInfo k_emlrtRSI = { 66, "eml_blas_xaxpy",
"C:/Program Files/MATLAB/R2012b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xaxpy.m"
};
/* Function Declarations */
static void eml_xaxpy(real_T a, const real_T x[4001], real_T y[4001]);
/* Function Definitions */
static void eml_xaxpy(real_T a, const real_T x[4001], real_T y[4001])
{
int32_T n;
int32_T incx;
int32_T incy;
emlrtPushRtStackR2012b(&i_emlrtRSI, emlrtRootTLSGlobal);
emlrtPushRtStackR2012b(&j_emlrtRSI, emlrtRootTLSGlobal);
n = 4001;
incx = 1;
incy = 1;
emlrtPushRtStackR2012b(&k_emlrtRSI, emlrtRootTLSGlobal);
daxpy32(&n, &a, &x[0], &incx, &y[0], &incy);
emlrtPopRtStackR2012b(&k_emlrtRSI, emlrtRootTLSGlobal);
emlrtPopRtStackR2012b(&j_emlrtRSI, emlrtRootTLSGlobal);
emlrtPopRtStackR2012b(&i_emlrtRSI, emlrtRootTLSGlobal);
}
void filter(const real_T b[4001], const real_T x[4001], real_T y[4001])
{
real_T dbuffer[4001];
int32_T j;
int32_T k;
memset(&dbuffer[1], 0, 4000U * sizeof(real_T));
for (j = 0; j < 4001; j++) {
for (k = 0; k < 4000; k++) {
dbuffer[k] = dbuffer[k + 1];
}
dbuffer[4000] = 0.0;
if (x[j] == 0.0) {
for (k = 0; k < 4001; k++) {
dbuffer[k] += x[j] * b[k];
}
} else {
emlrtPushRtStackR2012b(&h_emlrtRSI, emlrtRootTLSGlobal);
eml_xaxpy(x[j], b, dbuffer);
emlrtPopRtStackR2012b(&h_emlrtRSI, emlrtRootTLSGlobal);
}
y[j] = dbuffer[0];
}
}
thank you.