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

 채택된 답변

madhan ravi
madhan ravi 2018년 9월 9일
편집: madhan ravi 2018년 9월 9일

0 개 추천

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

댓글 수: 4

carl hooper
carl hooper 2018년 9월 9일
Thanks for your reply. If a=100; b=[1;2;3]; equation is: x=a+sum(b); I am looking for a solution that will satisfy x>b (i.e, x will be greater than any member of b.
madhan ravi
madhan ravi 2018년 9월 9일
편집: madhan ravi 2018년 9월 9일
syms x
a=100
b=[1;2;3]
assume(x>b)
eqn=x==a+sum(b)
sol=solve(eqn,x,'ReturnConditions',true)
sol.x
madhan ravi
madhan ravi 2018년 9월 9일
편집: madhan ravi 2018년 9월 9일
This will display the solution if and only if x greater than any member of b.
madhan ravi
madhan ravi 2018년 9월 9일
@carl did it satisfy?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2018년 9월 9일

댓글:

2018년 9월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by