MATLAB: Convert binary integers to quaternary integers

binaryconversionquaternary

Is it possible to convert binary integers generated using a randi() to quaternary integers (0-3) by taking two bits from the source and combining them?

Best Answer

Solved it myself. It can be done easily by converting back to decimal from Galois Field, reshaping into n x 2 matrix and adding the columns.
Related Question