latex_trick.m
Aucune licence
As documented in lshort.pdf, an easy way of aligning table columns in MATLAB to a decimal point is to break down the numerical entries into two columns, and set the alignment to 'r@{.}l', which places a decimal point between a right and a left aligned column.
This function changes decimal points in either a scalar or a matrix to a '&' to allow for using this technique.
For best results, combine with matrix2latex.m available on this site.
Usage:
% latex_trick(number, format)
% where:
% number is a matrix or a scalar, and
% format is a format string as if for fprintf.
% returns:
% a string if number is a scalar, or
% a string cell array otherwise.
Citation pour cette source
Christopher Granade (2024). latex_trick.m (https://www.mathworks.com/matlabcentral/fileexchange/9324-latex_trick-m), MATLAB Central File Exchange. Récupéré le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
- MATLAB > Language Fundamentals > Data Types > Numeric Types >
- MATLAB > Language Fundamentals > Data Types > Characters and Strings >
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > LaTeX >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.0.0 |