MATLAB Answers

## convert Matlab array to Latex

Asked by Del

### Del (view profile)

on 18 Jun 2013

I have an array of cells which I want to convert into a latex table.

I know for a simple array I can use the following command:

A = [1 2 3; 4 5 6; 7 8 9];
latex_table = latex(sym(A))


Which will create

latex_table =

\left(\begin{array}{ccc} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{array}\right)


However, if I have something like this

B = ['Hello World' '2' '3'; 'yes' 'a' '6'; 'yes' '8' 'john']


How can I create a latex table from the matrix B?

## Products

No products are associated with this question.

## 0 Answers

#### Join the 15-year community celebration.

Play games and win prizes!

Learn more

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

### MATLAB Academy

New to MATLAB?

Learn MATLAB today!