A matlab plugin for the datax LaTeX package[ctan].
Allows data to be saved in a form easily accessible from LaTeX.
Matlab:
a = 24.35;
b = 2;
c = 7.44;
d = 12;
datax('data.tex',a,'\meter','%.3g',b,'\kilo\gram',c,'%.2g',d)
LaTeX:
\documentclass{article}
\usepackage{siunitx}
\usepackage[dataxfile=data.tex]{datax}
\begin{document}
The measured distance was \(a = \datax{a}\).
\end{document}
This package is available in the MATLAB add-on explorer.
- I would love to plug this into the
symunit
framework, but the authors have made that very difficult. What I would need is a way to extract power, prefix and name of each unit in a compound unit. This seems theoretically possible - usefindUnits
to get the involved units, check them for SI prefixes (they are unfortunately not all single characters), uselog(x)/log(findunits(x))
(or possibly necessarilly checkfindunits(x/units(k)^m)
form = [1,-1,2,-2,3,-3...]
) to find the power, and convert frommg
to\milli\gram
via lookup table. This is all super painful, because the toolbox is missing some basic functionality.