【源码】latexTable——将矩阵、单元格和MATLAB表格转换为LaTex表格

【源码】latexTable——将矩阵、单元格和MATLAB表格转换为LaTex表格

本代码将矩阵、单元格和MATLAB表格转换为LaTex表格代码。

Converts matrices, cells or MATLAB tables to LaTeX table code.

本代码具有易用和灵活的特点:

Easy to use and very flexible:

MATLAB矩阵、单元格或者表格作为输入

  • takes MATLAB matrices, cells or tables as input

提供包含数据作为输出的LaTeX表代码

  • gives code for a LaTeX table containing your data as output

处理数字和文本/字符串数据

  • handles numeric and text/string data

很容易将其包含在自动化设计代码中

  • easy including in your code for automation

易于直接保存为LaTex文档(请参见runExamples.m中的示例2)

  • easy direct saving as a LaTex document (see example 2 in runExamples.m)

其它特点包括:

Optional features are:

表格定位

  • table positioning

列/行标记

  • column/row labels

列/行格式设置(如设置数字的位数等)

  • column/row-wise formatting (like setting the number of digits etc.)

表格旋转(通过90度旋转对行列数据进行反转)

  • pivoting the table (90 degree rotation making columns rows and vice versa)

对NaN数据设置缺省的符号

  • setting the default symbol for NaN values

LaTeX列对齐

  • LaTeX column alignment

LaTeX表格边框、标题、标签

  • LaTeX table borders, caption, label

输出完整的LaTeX文档,而不是普通表格

  • output a complete LaTeX document instead of a plain table

示例:

input.data=[1,3;4,2]; % set up data

latexTable(input) % obtain LaTeX code

更多的细节和示例可以在latexTable.m和runExamples.m中找到。

For further details and examples can be found in latexTable.m and runExamples.m

源码下载地址:

http://page2.dfpan.com/fs/clac2jc2e211f259160/

更多精彩文章请关注微信号:【源码】latexTable——将矩阵、单元格和MATLAB表格转换为LaTex表格