Hi Steven,
Actually I was searching something more simple who can generate the equations in text format. Maybe the example was too easy, because in C codes there are lots of things which don't correspond to Matlab coding rules. I don't know whether the methods you told can handle them well.
Anyway, thanks
"Steven_Lord" <slord@mathworks.com> wrote in message <k15ah8$3ea$1@newscl01ah.mathworks.com>...
>
>
> "SSOI SS" <wonderful.song@googlemail.com> wrote in message
> news:k14sgd$fcn$1@newscl01ah.mathworks.com...
> > Hi, a simple question but perhaps no easy answers:
> > Does anyone know whether there is an algorithm or way to convert code
> > (e.g. java, c etc) into a mathematically readable text format. One example
> > is:
> > Input:
> >
> > A = ( ( ( ( ( (X ) * Y ) / Z) * Q) * P) / R );
> >
> > Output:
> >
> > X * Y * Q * P
> > A = 
> > Z * R
>
> In MATLAB? Take a look at the PUBLISH function or, if your expression uses
> symbolic variables created using SYM or SYMS from Symbolic Math Toolbox take
> a look at the PRETTY function.
>
> In general? LaTeX, MathJax:
>
> http://blogs.mathworks.com/cleve/2012/06/03/clevescornerblogsedition/
>
> or some of the other options here:
>
> http://en.wikipedia.org/wiki/Category:Mathematical_markup_languages
>
> 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
