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. But mex function that i wrote doesn't give the correct output. However it compiles with no error.