A= [0.7577 0.7060 0.8235 0.4387 0.4898
0.7431 0.0318 0.6948 0.3816 0.4456
0.3922 0.2769 0.3171 0.7655 0.6463
0.6555 0.0462 0.9502 0.7952 0.7094
0.1712 0.0971 0.0344 0.1869 0.7547]
latex_table = latex(sym(A));
I save it as eqA.
equations1.tex
\newcommand{\eqA}{
\left(
\begin{array}{ccccc}
\frac{6825116339432507}{9007199254740992} &
\frac{6359497797823013}{9007199254740992} &
\frac{3708524368810113}{4503599627370496} &
\frac{987964467329731}{2251799813685248} &
\frac{4411405500742427}{9007199254740992}\\
\frac{6693542213068579}{9007199254740992} &
\frac{71681197541747}{2251799813685248} &
\frac{6258459855040489}{9007199254740992} &
\frac{859193262592067}{2251799813685248} &
\frac{1003370923741521}{2251799813685248}\\
\frac{55201045594335}{140737488355328} &
\frac{2494300503760379}{9007199254740992} &
\frac{2856178200482939}{9007199254740992} &
\frac{1723790560926853}{2251799813685248} &
\frac{2910735031501795}{4503599627370496}\\
\frac{2952009981953243}{4503599627370496} &
\frac{415874915283285}{9007199254740992} &
\frac{8558839330135289}{9007199254740992} &
\frac{3581261978445933}{4503599627370496} &
\frac{6389390375844301}{9007199254740992}\\
\frac{770956303438939}{4503599627370496} &
\frac{874885307559191}{9007199254740992} &
\frac{77565677658637}{2251799813685248} &
\frac{1683198784473707}{9007199254740992} &
\frac{6797613319514473}{9007199254740992}
\end{array}
\right)
}
//latex
\documentclass{article}
\input{equations1}
\begin{document}
Here we have a nice matrix:
\[
\eqA{}
\]
\end{document}
I ' m getting right answer but its different format: How can I get original format like A.

Last but not least, how can I add horizontal and vertical lines and lable colume and rows of the table. The contents of the table should be updated every time by input equation1.






equation1.texto your question) – David Carlisle Dec 20 '12 at 22:16sym()in Matlab, is the result better? – Torbjørn T. Dec 20 '12 at 22:23latex(double(sym(A)))– David Carlisle Dec 20 '12 at 22:25latexfunction not in the current folder in Matlab or its path? David's suggestion works fine here. – Torbjørn T. Dec 20 '12 at 22:31Error in ==> table at 12 latex_table =latex(double(sym(A)))
– user31177 Dec 20 '12 at 22:36latex.mis not in either the current folder of Matlab, or the path. File --> Set Path, add the folder where you placedlatex.m. But you've used it before, haven't you? Surely you know what you did to make it work then .. – Torbjørn T. Dec 20 '12 at 22:42symbeing from the symbolic math toolbox by the way.) – Torbjørn T. Dec 20 '12 at 22:44latex_table = latex(sym(A)) % it works latex_table =latex(double(sym(A))) % error
– user31177 Dec 20 '12 at 22:45latex(double(sym(A)))gives the same aslatex(A). – Torbjørn T. Dec 20 '12 at 22:46symanddouble? I.e.latex(A)? – Torbjørn T. Dec 20 '12 at 22:47latexfunction you are using or is it a differnt one? – David Carlisle Dec 20 '12 at 22:48