Formatting column names in a table of data
18 次查看(过去 30 天)
显示 更早的评论
I have calculated values for some variables and would like to produce a table containing those values, how do I format the column/row names to show Latex text (ex.
)?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/805879/image.png)
5 个评论
dpb
2021-11-19
编辑:dpb
2021-11-23
My bad -- I was thinking of extended ASCII character set and wrote unicode instead...you're correct, @Adam Danz, nothing but single-byte characters are rendered properly as variable name strings even though (misguided, but TMW bowed to pressure) you can now have things like blanks (including leading and trailing just to make it harder)!
table documentation specifically says
"Variable names can have any Unicode® characters, including spaces and non-ASCII characters."
Peter Perkins
2021-11-23
Really, this is supported to allow foreign-language variable names, andvar names containing parens and dots and other punctuation. Spaces came along because it really was not clear how to sensibly draw a cutoff line. There are subtleties that are not apparent.
You are both correct that arbitrary var names are a double-edged sword.
回答(1 个)
Srijith Kasaragod
2021-11-24
Hi Batool,
I assume you wish to name table variables as LATEX text and display the table in command window. MATLAB supports LATEX text in charting, annotations and publishing outputs. In such instances, the LATEX expressions will be interpreted as LATEX text and displayed appropriately. Command window does not render LATEX expressions and cannot be used to display publishable output. Instead the variable name would be displayed as the quoted LATEX expression.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 LaTeX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!