How to split up a Latex output from MATLAB?

2 views (last 30 days)
Hi, I have the immense output from MATLAB that does not show in Latex as it extends beyond the page border. I have tried to split it up manually, but it appears impossible.
Can someone suggest some way to do this?
if true
A = res.*C_n.*(-1).^n
digits(4)
which gives:
ans =
'\frac{C_{n}\,{\mathrm{e}}^{-\frac{g\,x\,2{}\mathrm{i}}{h}}\,\left(20327071985855924\,g^2-5081767996463981\,h^2\,{\mathrm{e}}^{\frac{g\,x\,2{}\mathrm{i}}{h}}-18014398509481984\,h^3\,\cos\left(x\right)+5081767996463981\,h^2-36028797018963968\,g^2\,h^2-5081767996463981\,h^2\,x^2+g\,h^3\,x\,27021597764222976{}\mathrm{i}+g^3\,h\,x\,36028797018963968{}\mathrm{i}-g\,h^3\,x^3\,9007199254740992{}\mathrm{i}-36028797018963968\,g^2\,h\,\cos\left(x\right)+5081767996463981\,h^2\,x^2\,{\mathrm{e}}^{\frac{g\,x\,2{}\mathrm{i}}{h}}+g\,h^2\,\sin\left(x\right)\,36028797018963968{}\mathrm{i}+18014398509481984\,h^3\,x\,\sin\left(x\right)-g\,h\,x\,20327071985855924{}\mathrm{i}+36028797018963968\,g^2\,h^2\,x^2+9007199254740992\,h^3\,x^2\,\cos\left(x\right)+g\,h^2\,x\,\cos\left(x\right)\,36028797018963968{}\mathrm{i}\right)}{18014398509481984\,h^2}'
latex(A) diary off ;%t

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!