Matrices: Inverse - Calculation

The inverse calculation is demonstrated for a 3 x 3 matrix shown below. It is quite tedious

» A=[1 2 3;4 1 2;5 4 2]    % define A
A =
      1            2            3
      4            1            2
      5            4            2
» inv(A)           % inverse of A
ans =
    -6/31         8/31         1/31
     2/31       -13/31        10/31
    11/31         6/31        -7/31