MATLAB: Undefined function ‘minus’ for input arguments of type ‘sym’

algebraic equationssolveSymbolic Math Toolboxundefined function

This is my first time with the Symbolic Math Toolbox, 2012b. The following code
syms x y
[sol_x, sol_y] = solve(x^2 + y == 1, x - 2*y^2 == 2)
produces the error
Undefined function 'plus' for input arguments of type 'sym'.
What am I doing wrong? There were a lot of threads on roughly this subject, but I couldn't find one where the answer applied to my situation.
Thanks, Kurt

Best Answer

There could be version differences between 2012a and 2013b (that I’m running here). (I don’t have access to 2012a any more, so I can’t test your code with it.)
Your code works fine for me as you posted it, and produces:
sol_x =
- 1.0997213367630765988805181024643 + 0.56837679138702087076241385221614*i
- 1.0997213367630765988805181024643 - 0.56837679138702087076241385221614*i
1.0997213367630765988805181024643 + 0.30938949574368425547005924661781*i
1.0997213367630765988805181024643 - 0.30938949574368425547005924661781*i
sol_y =
0.11366515845543691213299333209121 + 1.2501121696184858278179094827946*i
0.11366515845543691213299333209121 - 1.2501121696184858278179094827946*i
- 0.11366515845543691213299333209121 - 0.68048445967939729425829595210914*i
- 0.11366515845543691213299333209121 + 0.68048445967939729425829595210914*i
Related Question