フィルターのクリア

Show matlab code equation in mathtype or pdf or latex format

11 ビュー (過去 30 日間)
CARA
CARA 2015 年 9 月 13 日
回答済み: Walter Roberson 2015 年 9 月 13 日
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
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
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.

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by