This project is a simple tool for converting matrices written in MATLAB-style formatting into LaTeX-friendly syntax. It doesn't require MATLAB itself and is designed for scenarios where you want to take advantage of the concise MATLAB matrix syntax in LaTeX documents.
Formating a matrix in MATLAB is faster than formating it in LaTeX. – Sun Tzu, the art of formating
-
Clone this repository to your local machine:
git clone https://github.com/ImStian/MATLAB_TO_LATEX_MATRIX.git
-
Navigate to the project directory:
cd MATLAB_TO_LATEX_MATRIX
-
Run the conversion script:
python main.py
-
OR Execute the provided executable file:
./latex_matrix_generator.exe
-
Enter the matrix which should be converted, and click confirm.
Type the matrix as you would in MATLAB with commas (,) separating row elements and semicolons (;) separating rows to get proper LATEX formating.
Input:
"[1,2;3,4]"
Output:
$\begin{bmatrix}
1 & 2\\
3 & 4\\
\end{bmatrix}$