# LaTeX MATLAB and LaTeX syntax

1. Sep 9, 2015

### Maylis

Hello,

I am trying to publish a file on matlab, and for some reason it won't accept my code, even though it works on this forum. Does matlab use some other syntax for matrices?

$$\vec {x} = \begin {bmatrix} T-T_{s} \\ C_{A} - C_{As} \\ C_{P} - C_{Ps} \end {bmatrix}$$

#### Attached Files:

File size:
46.7 KB
Views:
165
Last edited: Sep 9, 2015
2. Sep 10, 2015

### Staff: Mentor

I've never mixed Matlab with LaTeX, but bmatrix is not part of LaTeX, it is an AMS extension.

You have to do matrices in regular LaTeX "manually," something like
Code (LaTeX):

\left[ \begin{array}{c} a \\ b \\ c \end{array} \right]

3. Sep 10, 2015

### Maylis

Thank you, that fixed it.

4. Sep 10, 2015

### Maylis

I still don't understand why matlab won't accept this, but the latex on PF will (what is going on with the dCA/dt term !?)

$$\vec {\dot {x}} = \left[ \begin{array}{c} \frac {dT}{dt} \\ \frac % {dC_{A}}{dt} \\ \frac {dC_{P}}{dt} \end{array} \right] = \left[ \begin{array}{c} -\frac{F}{V} & F \frac {\Delta H_{rxn}}{\rho V c_{p}} & \frac {\beta}{\rho V c_{p}} \frac {1}{2 \sqrt{C_{P}}} \\ 0 & -\frac {F}{V}-2kC_{A} & 0 \\ 0 & 2kC_{A} & - \frac {F}{V} \end{array} \right]$$

#### Attached Files:

File size:
10.9 KB
Views:
122
File size:
10.9 KB
Views:
132
Last edited: Sep 10, 2015
5. Sep 10, 2015