Suppose I have the polynomial given by the determinant of this matrix:
matry = {{1 - R, 3, -3}, {1, 0 - R, 0}, {0, 1, 0 - R}}
I am feeding the Mathematica output into a Perl program, and when I evaluate
Det[matry]
, I get the output:
2 3
-3 + 3 R + R - R
The polynomial spans over two lines - no good. So I try
CForm[ Det[matry] ]
, and I get:
-3 + 3*R + Power(R,2) - Power(R,3)
Is there an easy way to get a nice output of something like -R^3 + R^2 + 3*R - 3
in one line of plain text?
ToString[InputForm[Det[matry]]]
? $\endgroup$