Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we convert LaTeX representation to symbolic math functions in matlab?

How can we convert Latex representation into symbolic math.

For example,

A LaTex representation

y = \int x^2  

Has an equivalent symbolic math representation as

syms x
y = int(x*x, x)

Is there a function to perform this action? I know that there exists a function latex in matlab and I want the exact inverse of this function.

like image 404
Ankit Chiplunkar Avatar asked Feb 02 '15 16:02

Ankit Chiplunkar


People also ask

Can you do symbolic math in MATLAB?

You can create, run, and share symbolic math code. In the MATLAB® Live Editor, you can get next-step suggestions for symbolic workflows. The toolbox provides functions in common mathematical areas such as calculus, linear algebra, algebraic and differential equations, equation simplification, and equation manipulation.

How do I print a symbolic expression in MATLAB?

You can use the CHAR method for symbolic objects to convert them to strings and the FPRINTF function to print the strings to the screen. Here's an example: syms x y z; %# Define symbolic variables eq = 2*x+3*y+4*z; %# Create symbolic equation fprintf('The equation for the rectifying plane is: %s = D. \n',char(eq));


1 Answers

Matlab latex command converts matlab's syntax to latex's syntax. There is no function in matlab that parses LaTeX syntax into matlab's.

Your closest approximation to latex syntax inside Matlab is MuPAD.

like image 104
bendervader Avatar answered Oct 27 '22 00:10

bendervader