How do i find x in an equation using the solve command?

2 次查看(过去 30 天)
Hi everyone,
I use MATLAB R2015a.
Can't solve a x in the matlab even for the simpliest equation like x-2=0. tryed everything.
thank you for your help.
  1 个评论
Darshan Sen
Darshan Sen 2019-11-22
Hello Shimon. What error are you getting? Do you have the Symbolic Math Toolbox add-on?
Here's a thread you might find useful. :)

请先登录,再进行评论。

采纳的回答

Darshan Sen
Darshan Sen 2019-11-22
Once you have the Symbolic Math Toolbox add-on, you may solve the equation like this
syms x
eqn = x - 2 == 0;
solx = solve(eqn, x)
You'll find this link useful too.
Hope this helps. :)

更多回答(1 个)

Erivelton Gualter
Erivelton Gualter 2019-11-22
Do you have Symbolic Math Toolbox?
Try the following:
syms x
fcn = x-2;
solve(fcn == 0)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by