I used format rat at the top to try to get all the decimals into fractions but then instead of printing 0 it put an asterisk. Does anyone know a way to still get everything into fractions and keep the 0 in the last row?
As explained by the MathWorks Support Team in this answer, an asterisk indicates that the fraction is too long to display. The first example below is the same value as the first element of the second example but it appears as an asterisk in the second example because the results are too long to display.
A = [1/1125899906842624, pi, exp(1)]
* 355/113 1457/536
Solution: You can round the values to a number of decimal places that meet your precision needs. Below I round them to 6dp.