Undefined function 'minus' for input arguments of type 'sym'

1 view (last 30 days)
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

Accepted Answer

Star Strider
Star Strider on 4 Mar 2014
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
  4 Comments
Kurt
Kurt on 5 Mar 2014
Thanks. "solve" wasn't shadowed. It turns out that I needed to have the equations in single quotes for 2012b. Then it worked!
Star Strider
Star Strider on 5 Mar 2014
My pleasure!
I remember that there were version changes, but I couldn’t remember what the syntax was in 2012b.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!