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!