Show matlab code equation in mathtype or pdf or latex format
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
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)
Réponses (1)
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!