This is a follow-up question to another SO question of mine.
I have a large array of 8 bit binary values that I want to convert back to uint8.
I have used Amro's lookupTable solution from the previous question. Now I want to do the reverse. I wanted to do a lookup table but sadly I am unable to.
What I managed to do is the following:
temp = ones([(TotalPixel),1], 'uint8');
for iter2 = 1 : TotalPixel,
temp(iter2,1) = sum(Data(iter2,1:8).*2.^(7:-1:0));
end
But the for loop is too slow as it takes 2 seconds to convert a [76800 x 1] array. Is there a better/faster way to do this?