The difference between LaTeX vs MuPAD vs Matlab
No, converting general LaTeX equations into some sort of procedural programming language is most decidedly not possible.
LaTeX is a system for creating documents with structured text formatting and typesetting. It is not much different than writing individual letters and symbols onto a piece of paper yourself; there are no intrinsic semantics as to which symbols mean what. It doesn’t know (or care) if the expression x = y is an assignment or a test for equality. Or if \cdot is a dot product or simple multiplication. All that really matters in the end is that the equations are readable and look good to a human eye. To convert this soup of symbols into a procedural programming language is quite impossible.
MuPAD, however, is a computer algebra system. You tell it what is a function and what are variables. It has this knowledge. As such, it is able to identify inputs and outputs and some sort of directional flow. It has a grammar to its equations: you must, for example, use := to denote assignment. When converting to an m-file, MuPAD uses this additional information to determine which variables are scalar or vector, what is an assignment and what is a boolean test, what is input and what is output, etc.
This difference is obvious in usage of MuPAD vs LaTeX: one can rearrange and simplify your equations for you, the other cannot.
Comments