MATLAB: How to solve the problem

cryptographydecryptionencryptionImage Processing Toolbox

I have a dicom image,I of size :
size(I)
ans =
716 1000 3
From this I took first 64 bits,like I(1:16),I(17:32),I(33:48),I(49:64) and did the encryption operation. So before sending it I would like to get back the remaining bits and thus get back the image?
I hope the question is clear.Here I took Ist rows upto 64. This is stored in suppose a variable A.How to get the remaining bits, so that if store the variable in B. So that after decryption of A,I can concatenate with B and get back the final image.
Can somebody help me out to get this?

Best Answer

A1bits = reshape((dec2bin(typecast(A1, 'uint8'), 8) - '0').', 1, []);
This will be a row vector. Once you have done this up to A4 then you can do
[A1bits, A2bits, A3bits, A4bits]
Related Question