How to find the value of a variable in MATLAB that exists on both sides of th eequal sign?
显示 更早的评论
Does anybody know how we can find the value of a variable in MATLAB that exists on both sides of equal sign, e.g. n in 2n+q=n+r (n is the only variable)?
In this case it is so simple; n=r-q. But what if the equation is very complex and we are not able to transfer the variable to one side?
采纳的回答
更多回答(1 个)
Brian B
2014-5-16
If you have the Symbolic Toolbox, you can use:
>> syms n q r
>> solve('2*n+q=n+r','n')
ans =
r - q
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!