Show matlab code equation in mathtype or pdf or latex format
13 次查看(过去 30 天)
显示 更早的评论
Hello!
Once I have entered an equation in matlab is there a way to "see" it in another format just to double check if I entered it correctly? I mean, if I have an equation that looks messy like the following for example:
f(2)=-(b+1)*y+d+g*n*(x2.^a*y.^(1-a)*p.^a-(1./z)*x2-ff-s)+(1-g)*n*((1-a)./(a*h).^(a./(a-1))*y*p.^(a./(1-a))-ff);
1 个评论
Ruben Jimenez
2020-7-6
Try this:
syms b y d p ff s g n x2 x1 a z h
f(2)=-(b+1)*y+d+g*n*(x2.^a*y.^(1-a)*p.^a-(1./z)*x2-ff-s)+(1-g)*n*((1-a)./(a*h).^(a./(a-1))*y*p.^(a./(1-a))-ff);
pretty(f)
回答(1 个)
Walter Roberson
2015-9-13
Symbolic expressions (only) are automatically "pretty-printed", and for symbolic expressions only you can use the latex() command to convert them to LaTeX format.
I do not immediately see any routine or file contribution to convert MATLAB code to LaTeX, but there might be one somewhere.
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!