Effacer les filtres
Effacer les filtres

Show matlab code equation in mathtype or pdf or latex format

11 vues (au cours des 30 derniers jours)
CARA
CARA le 13 Sep 2015
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 commentaire
Ruben Jimenez
Ruben Jimenez le 6 Juil 2020
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)

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 13 Sep 2015
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.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by