MATLAB: Easy bit reversal bitsdata typeMATLAB I need a function to reverse the bits of an int. I see I can flip bytes around, but that doesn't reverse the bit order. Any easy ideas? Thanks. Best Answer sum(uint32(bitset(0,1:32,bitget(uint32(X), 32:-1:1))))(yes, there are other ways, some of them quite short but not necessarily efficient.) Related SolutionsMATLAB: How to deal with 32 bit and 64 bit integers in matlab Just convert to double or single, using for exampley = sqrt(double(x));Round the result and convert back to an integer if necessary.Alternatively, write a square root function that uses purely integer arithmetic. It will probably be slow though. I'd do the conversion. MATLAB: Binary Bit Masking bitand(), bitor(), Related QuestionBit reversal in a VectorCompile a 32-bit shared library from a 64-bit Linux machine with 64-bit MATLAB installedFourier transform on conjugate time reversalMCR: Running a 32-Bit executable on a 64-Bit systemGet bits of number.
Best Answer