On 1 Sep, 08:26, "basudha pradhan" <lucky_faith_...@hotmail.com> wrote: > I just started learning writing mex function. In C function > bitplan(), it take integer array as an input and it convert > each element of array from decimal to 8 bit binary. then > MSB of every element is taken and written to a file, after > that next significant bit of every element is taken and > written to a file. In this way integer array is separated > into bit plane. > > I have tested the C function it works properly.
How did you test it?
> But mex > function that i wrote doesn't give the correct output.
That's a clue for where to look for an error, right?
> However it compiles with no error.
C is a beast; you have to master it. It gives you exactly what you ask for, it is your job to ask for what you want...
> /* Get the data. */ > pr = (int *)mxGetPr(prhs);