Search code examples
matrixwolfram-mathematicadecimalfractions

Mathematica - printing a matrix, have fraction, want decimal to 6 places


Hi i am currently taking a Matrix, P, and doing this

     P500 = MatrixPower[P, 500];

and i print it back out with P500//MatrixForm but many of the numbers are these HUGE fractions, and i want decimals to six places. can anyone help?


Solution

  • Simply convert P to machine numbers before exponentiation:

    MatrixPower[N[P], 500]