## convert Matlab array to Latex

### 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.

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