mat2fig - Conversion from a matrix to a figure

Versión 1.0.0.0 (2,98 KB) por Ondrej
Function for converting a matrix into a figure (eps,fig,jpg,etc.) and latex code.
635 Descargas
Actualizado 18 mar 2012

Ver licencia

Function for converting a matrix into a figure and latex code. Useful when a matrix in a latex document must be resized differently than standard latex sizes can offer (e.g., \includegraphics[width=\textwidth]{matrix.eps} ).

varargout = mat2fig(A,varargin) - conversion from matrix to a figure

INPUT: A - input matrix
optional:
'FileName' - name of the file. Type: eps(default), jpg, png,...
'MatName' - matrix name: 'on','off',"name"
'align' - alignment of the elements in the matrix: 'l','c','r'
'bracket' - type of bracket: '(','[','{','|','\|'

OUTPUT: eps file + latex code

example:
mat2fig([1 2;3 4]);
mat2fig([1 2;3 4],'MatName','B','bracket','[');
mat2fig([1 2;3 4],'FileName','Matrix');
mat2fig([1 2;3 4],'FileName',{'Matrix','jpg'});
mat2fig([1 2;3 4],'MatName','A_{b}');
mat2fig([1 2;3 4],'MatName','A_{b}','align','r','bracket','\|');
mat2fig([1 2;3 4],'FileName',{'A.eps','psc2'},'MatName','A_{b}','align','r','bracket','\|');

In LATEX amsmath package is required (due to \setcounter{MaxMatrixCols}{}).

Known BUGS:
1. Matrices of size bigger than 10 cannot be converted (because of latex interpreter in matlab)! For cases of >10 only latex code
is produced.
2. Figures are sometimes cut and not correctly bounded (eg. case of jpg
format). Restarting matlab can possibly help.

Citar como

Ondrej (2024). mat2fig - Conversion from a matrix to a figure (https://www.mathworks.com/matlabcentral/fileexchange/35708-mat2fig-conversion-from-a-matrix-to-a-figure), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2009b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Printing and Saving en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas
Agradecimientos

Inspirado por: matlabfrag

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0