It is routine to find this polynomial and so it is not surprising that MATLAB is able to do it for you. I recommend doing this rather than all the trouble just described. The syntax to use is this:
>> A=[1,2,3;3,-3,1;2,7,1]; minpoly(A) Here you press enter. It gives:
1 1 -24 -69
These are the coefficients of the minimum polynomial which is
The matrix you entered was
You open MATLAB and you see >>. Then type in just what is above. The ; at the end after entering the matrix says for MATLAB to know the matrix but not to rewrite it. You can of course follow the same pattern to enter any square matrix you like. Then of course you are faced with the problem of finding the roots of the polynomial. Sometimes you can’t do this exactly. Neither can MATLAB. However, when the polynomial can be factored, MATLAB can do it for you. Here is the syntax.
>> syms x
factor(xˆ2-3*x+2) (here you press enter and what results is:)
To get to a new line in MATLAB you press shift enter. You factored x2 − 3x + 2. You can enter any polynomial you like, but sometimes they can’t be factored exactly. When this happens, MATLAB will just return the original polynomial. This is its way of saying that it has no idea how to do it.