MATLAB: Solve linear system by trial and error

solve linear system by trial and error

I need to solve an equation like x=a+b; putting a condition such that x>b. How can i do that in matlab ?

Best Answer

Try this:
syms x a b
assume(x>b)
eqn=x==a+b
sol=solve(eqn,x,'ReturnConditions',true)
sol.x