You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to latex...@googlegroups.com
Hi, Some of you know that Matlab has a command called 'latex()' which gives latex code when a symbolic expression is passed as input argument.
But we don't generally use symbolic variables (at least I won't use), so how to get LaTeX code?
At least for matrices and variables I have found a way.
Suppose you have a 10x10 matrix stored in variable Y which could be the output matrix of your program. Now feeding this data in to LaTeX is not an easy task.
But you can use the following command
Y1=vpa(Y); %variable precision arithmetic
The above command converts Y in to symbolic variable and stores in to Y1. Now the command
latex(Y1)
gives you directly the LaTeX code for 10x10 matrix.
Just copy and paste that code in your tex file. You may have to do little formatting to get as per your requirements.
You may refer "Publishing M-Files" in Matlab help for knowing more about working with LaTeX in Matlab