The bigger question is why do you want to do this. I can't think of a single scenario where the representation you're asking would be useful.
In any case, it's not possible. A matrix in matlab is displayed as decimal numbers not binary. Furthermore, leading 0s are always omitted (since there's an infinity), so the closest you could do would be:
which would contain the decimal numbers 100 (binary representation: 1100100), 110 (binary representation: 1101110), and 111 (binary representation: 110111). If that's what you want, then:
A = [0 1 0 1 0 1 1 0 0 1 1 1]
B = sum(reshape(A, 4, []) .* 10.^(3:-1:0)')
But as said, I don't see how that could be useful for anything. You certainly can't easily do any binary math on this, since the numbers are decimal.
Another option would be to convert to a string, which would allow the leading 0 (as a character)
A = [0 1 0 1 0 1 1 0 0 1 1 1]
B = cellstr(reshape(char(A + '0'), 4, []).').'
Best Answer