Perhaps you typed "solve" and "matlab" into Google and came across this page. Note the warning in the yellow box at the top of the page that @ChristopherCreutzig alluded to in his answer. MuPAD is a separate environment available to Matlab users – type mupad
in your command window and you'll be able to run your command – but its functions are not directly callable from within Matlab. Many (if not most) of the functions in the Symbolic Math toolbox use the MuPAD engine under the hood. In your case you can call numeric::solve
from within Matlab like this:
syms x;
s = feval(symengine, 'numeric::solve', x^6 - sym(pi)*x^2 == sin(3), x)
or using the older string format:
s = feval(symengine, 'numeric::solve', 'x^6 - pi*x^2 = sin(3)', 'x')
The output of either can then be converted to double precision column vector with s = double(s.')
. However, in this case there seems to be no reason not to use sym/solve
instead:
syms x
s = double(solve(x^6 - sym(pi)*x^2 == sin(3), x).');
See this for further details and other options for calling MuPAD functions from within Matlab.