git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4241 818b1a75-f10b-46b9-bf7c-635c3b92a50f
21 lines
459 B
C
21 lines
459 B
C
#include "../../../defs.h"
|
|
|
|
void mexFunction( int nlhs, mxArray *plhs[],
|
|
int nrhs, const mxArray *prhs[]
|
|
)
|
|
{
|
|
|
|
/* Declare */
|
|
unsigned int x;
|
|
unsigned char *l2;
|
|
|
|
/* Allocate input */
|
|
x = (unsigned int) mxGetScalar(prhs[0]);
|
|
|
|
/* Allocate Output */
|
|
plhs[0] = mxCreateNumericMatrix(1, 1, mxUINT8_CLASS, mxREAL);
|
|
l2 = (unsigned char*) mxGetPr(plhs[0]);
|
|
|
|
/* Algo */
|
|
*l2 = log2_approx(x);
|
|
} |