Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
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}

How can I add horizontal and vertical lines and label column and rows of the table. The contents of the table should be updated every time by input eqA. please see imageenter image description here

share|improve this question
1  
Ugliest figure I've seen on Tex.SX :) –  recluze Dec 21 '12 at 11:48
    
There are other ways of getting a matrix from Matlab to a LaTeX table, e.g. mathworks.de/matlabcentral/fileexchange/4894-matrix2latex See if that does all you want. (It may not work with symbolic stuff, so you won't get the fractions, but from your other question it seems you're after decimals anyway.) –  Torbjørn T. Dec 21 '12 at 15:23
    
@ Torbjørn Thanx for ur reply. How can I change your comments as answer, so that I can click this question as answered. –  user31177 Jan 1 '13 at 10:15
add comment

2 Answers 2

You can use \hline between the rows to get horizontal lines and | in the array preamble to specify vertical lines. As (again) you have not posted an example that may be run locally I haven't shown the result of adding these.

\begin{array}{|c|c|}
\hline
a&b\\
\hline
x&y\\
\hline
\end{array}

is a 2x2 example with horizontal and vertical rules.

share|improve this answer
add comment
up vote 0 down vote accepted

I used mathworks.de/matlabcentral/fileexchange/4894-matrix2latex and it works well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.