# Regarding Changing Captions and Including Them in Different Lists of Interest

I have created several large tables in Excel and MATLAB. Since it is very time-consuming to manually copy and paste these tables in LaTeX, I would like to include them as figures in LaTeX. I would really appreciate it if someone could help me with the following questions:

1. Is it possible to include tables from MATLAB or Excel without having to manually copy and paste the cells in LaTeX?

2. If I import a table as a figure into LaTeX, how can I change the caption from "Figure" to "Table" and have it listed in the "List of Tables" instead of "List of Figures"?

-

## migrated from stackoverflow.comFeb 26 '12 at 23:59

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Feb 27 '12 at 0:08

Part 2 is easier. If you include your table inside a table environment (\begin{table}\end{table}), it will appear in the \listoftables. Nothing will stop you from inserting a figure with \includegraphics inside the environment.

For Part 1, I usually print foreign information to PostScript and use \includegraphics from the graphicsx package. You may need to process the file in a drawing application to crop the boundaries.

-
Thank you so much for your response. I really appreciate your help. Shabnam – SHA Mar 1 '12 at 19:17

To answer question 1: There is a Matlab function that exports the data from a Matlab matrix to LaTeX tabular format, check it out here: http://www.mathworks.de/matlabcentral/fileexchange/4894-matrix2latex

Simple example: In Matlab, type:

matrix2latex(mymatrix,'myfilename.tex') % Creates a file named myfilename.tex
% with a tabular environment containing
% the data from mymatrix


In you LaTeX document use:

\begin{table}
\centering
\input{myfilename}
\caption{mytitle}
\end{table}


To include the table in your document as a table.

There is also a similar thing for Excel, a macro if I remember correctly: http://ctan.org/tex-archive/support/excel2latex/

-