1

I'm sometimes dealing with matrices up till 20*20 - Is there a way to import these into LaTeX rather than manually typing them via the \begin{matrix} command?

The matrices are usually constructed in MATLAB or Maple - No luck on extracting them from there so far.

So far I have been making screendumps and inserting them as figures, but I would like to utilize the matrix-framework provided in LaTex.

Thank you in advance!

koleygr
  • 20,105
  • 1
    import from what? many systems will export their matrices in latex syntax, matlab. mathematica, R etc or just output a csv file and let latex read it via datatool or similar or ... – David Carlisle Oct 18 '17 at 17:57
  • 1
    How is the matrix stored? In a simple text file? What does the matrix contain? Just numbers, symbols, or even entire math formulas? Are the cells separated by whitespace, commas, ampersands, or something else? – Mico Oct 18 '17 at 17:59
  • The short answer is yes but we need a minimal working example showing what your matrices look like, both in terms of the input and the expected output. –  Oct 18 '17 at 18:08
  • Related: https://tex.stackexchange.com/questions/224415/build-pgf-tikz-matrix-from-csv-file, https://tex.stackexchange.com/questions/146716/importing-csv-file-into-latex-as-a-table, https://tex.stackexchange.com/questions/54990/convert-numpy-array-into-tabular –  Oct 18 '17 at 18:09

1 Answers1

2

I found the solution, and as it turns out, it was a quite simple on - so I thought I would share it with you.

MATLAB lets you convert any matrix into LaTeX code by using following command:

In MATLAB

Latex_Matrix = latex(sym(A))

where A is your defined matrix.

In Maple Execute your matrix, right-click the result then "Conversions->LaTeX".

The result should be ready LaTeX code.