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 Related SolutionsMATLAB: How to simplify a symbolic polynomial with respect to x Hi,use thecollectcommand:syms a b c xequ = (x-a)*(x-b)+(x-c)f = collect(equ)gives:f = x^2 + (1 - b - a)*x - c + a*bwhich is the version you want sorted by powers of x - just a little bit rewritten, but following your wishes.Best regardsStephan MATLAB: Solving multiple symbolic equations to get (X/Z) Hi,i guess you want this:syms X Y Z a b c deqn(1) = X == a * Y + b * Z;eqn(2) = Y == c * X + d * Z;sol = solve(eqn,[X Z]);x = sol.Xz = sol.Zwhich is:x =(Y*b + Y*a*d)/(d + b*c)z =(Y - Y*a*c)/(d + b*c)Best regardsStephan Related QuestionHow to solve this equationSolving two symbolic equations simultaneouslySimplifying symbolic expression in terms of other variablesNumber of solutions of a system of linear equationsI cannot get the error.
Best Answer