You can read hexadecimal and binary numbers from a file and store them as numeric variables in a table. The readtable function automatically reads hexadecimal and binary numbers when they include the 0x and 0b prefixes respectively. The numeric values are stored using integer data types. You can also use import options to read such numbers when they do not have prefixes.
Preview the hexAndBinary.txt file in a text editor. It has columns of hexadecimal and binary numbers with prefixes, and one column without.
Read the file using readtable. The function detects the numbers with 0x and 0b prefixes and stores them as integers. The third column does not have prefixes so its values are treated as text.
T = readtable('hexAndBinary.txt')
T=3×4 table