function b = genAllTenBit

bin_array = zeros(2^10, 10);
bin_array = char(bin_array);


% Convert string chars into col-vector of binary strings.
for j = 1:length(bin_array)
    bin_array(j,:) = dec2bin(j-1, 10);
end
% Transpose array (due to the way matrix elements are enumerated, this will let reshape work).
% Subtract '0': ie. map it from ASCII representation of '0' to actual 0 (ie. NULL in ASCII). This automatically convert it to a double-array.
% Reshape into row-vector. 
% '[]' lets 'reshape' automatically calculate row size.
b = reshape(bin_array.'-'0', 1, []);