MATLAB: How to divide 8 bit binary into two 4 bit binarypartition For example A=11001111, i want to break it as A1=1100 and A2=1111. How it can be done in matlab? Best Answer A = '11001111' A = mat2cell(A, 1, [4, 4]); celldisp(A) Related SolutionsMATLAB: Bit Flip-Bit Negation bitflip = @(val, n) bitxor(val, 2.^(n-1)); MATLAB: Bit flipping @WalterI was waiting for mahaveer to show some effort :(Just for the record here's my code:c=[1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1] nbflip=6; %flip 6 bits v=nbflip:nbflip:numel(c); %make a vector with all the index values of c to flip c(v)=not(c(v)); %flip the bits Related QuestionConverting 4 bits to 5 bitsBinary Bit MaskingExchange bit-planesConvert 16 bit to 32 bit
Best Answer