matlab equation to latex

8 次查看(过去 30 天)
Hello,
I am trying to convert a matlab equation to latex using a script like:
chr = latex(x^2 + 1/x)
The output is :'\frac{1}{x}+x^2'
Are there anyway to include '\displaystyle' before \frac
  2 个评论
Nyemwerererai Matshaka
编辑:Nyemwerererai Matshaka 2023-5-10
can I have the code for conversion?
Walter Roberson
Walter Roberson 2023-5-10
What are the rules about where the \displaystyle should be put in?
regexprep(chr, '\\frac', '\\displaystyle\\frac')

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2023-4-25
The latex function does not have any option to add that in automatically, so you would need to use text manipulation to add it in.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Filter Design 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by