MAT2TEX

(Vectorised) LaTeX code for a matrix
2.3K Downloads
Updated 30 Sep 2005

No License

MAT2TEX LaTeX code for a matrix.

MAT2TEX(X) returns latex code for NUM2STR(X).

MAT2TEX(X,FORMAT) returns latex code for NUM2STR(X,FORMAT).

See also num2str.

Example:

mat2tex(rand(6,4)*9999) =

$\left[ \begin{array}{cccc}
9500.3427 & 4564.2202 & 9217.2079 & 4102.2918 \\
2311.154 & 185.01793 & 7381.3343 & 8935.6017 \\
6067.819 & 8213.2502 & 1762.4852 & 578.85516 \\
4859.3387 & 4446.5889 & 4056.6564 & 3528.3285 \\
8912.0984 & 6153.708 & 9353.7615 & 8130.8518 \\
7620.2062 & 7918.5784 & 9168.1275 & 98.603145
\end{array} \right]$

Cite As

Mukhtar Ullah (2026). MAT2TEX (https://www.mathworks.com/matlabcentral/fileexchange/8373-mat2tex), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0

Fixed a bug!