How to find the value of a variable in MATLAB that exists on both sides of th eequal sign?
Show older comments
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?
Accepted Answer
More Answers (1)
Brian B
on 16 May 2014
If you have the Symbolic Toolbox, you can use:
>> syms n q r
>> solve('2*n+q=n+r','n')
ans =
r - q
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!