Files
openairinterface5g/openair1/USERSPACE_TOOLS/MATLAB/PHY/TOOLS/mexfiles/log2_approx.c
T
2013-10-21 14:39:37 +00:00

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);
}