latex

バージョン 1.0.0.0 (2.48 KB) 作成者: Toby Driscoll
Output a matrix in LaTeX format.
ダウンロード: 7.6K
更新 2002/12/17

ライセンスの表示

This file will output a MATLAB numeric matrix in a format suitable to paste into a LaTeX tabular environment. You can choose whether to individually cast each element in math mode (you wouldn't want to in the AMS bmatrix environment, for example). You can also choose a format specifier independently for each column of the matrix.

I find this useful to convert true matrices, convergence tables, and the like into a document-ready form. It's independent of the Symbolic Toolbox.

Examples:>> latex(toeplitz(1:4))
$1.0000$ & $2.0000$ & $3.0000$ & $4.0000$ \\
$2.0000$ & $1.0000$ & $2.0000$ & $3.0000$ \\
$3.0000$ & $2.0000$ & $1.0000$ & $2.0000$ \\
$4.0000$ & $3.0000$ & $2.0000$ & $1.0000$ \\

>> latex(toeplitz(1:4),'%i','nomath')
1 & 2 & 3 & 4 \\
2 & 1 & 2 & 3 \\
3 & 2 & 1 & 2 \\
4 & 3 & 2 & 1

>> latex(toeplitz(1:4),'%i','%.2f')
$1$ & $2.00$ & $3.00$ & $4.00$ \\
$2$ & $1.00$ & $2.00$ & $3.00$ \\
$3$ & $2.00$ & $1.00$ & $2.00$ \\
$4$ & $3.00$ & $2.00$ & $1.00$

引用

Toby Driscoll (2024). latex (https://www.mathworks.com/matlabcentral/fileexchange/2832-latex), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R13
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersLaTeX についてさらに検索
謝辞

ヒントを与えたファイル: LaTeX table element wrapper

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0