Why do I get an error when I try to use the solve function?
2 次查看(过去 30 天)
显示 更早的评论
When I type the following command in matlab >> [x,y] = solve('x+2*y=4','2*x - y=3'),
I get the following error
Check for incorrect argument data type or missing argument in call to function 'solve'.
I was hoping someone could help me fix this. Thanks.
0 个评论
采纳的回答
Star Strider
2022-3-20
The quoted character array notationi may no longer be usable.
Try this isntead —
syms x y
[x,y] = solve(x+2*y == 4, 2*x - y == 3),
.
0 个评论
更多回答(1 个)
Paul
2022-3-20
solve() requires the inputs to be Symbolic Math objects
syms x y
[x,y] = solve(x + 2*y == 4, 2*x - y == 3) % note the use of == as required to define an equation
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!