Rearrange Variables in an equation
이전 댓글 표시
I declare the variables using sym or syms then i have an equation a+2*b=1; I want MATLAB to give me a=1-2*b; or alternatively b=(1-a)/2;
is there a way to do this?
Also, There maybe more than 2 variables Equation maybe linear or non-linear Equation can change at each iteration. Thanks
채택된 답변
추가 답변 (2개)
Nitesh khanna
2020년 8월 1일
0 개 추천
how to replace the variables a, b, c, d by variables w, x, y, z for; in eqn
eqn=a+b+c+d==9;
will this command work
eqn=subs(eqn, [a,b,c,d],[w,x,y,z])
Bill Tubbs
2023년 1월 29일
>> syms a b
>> eqn1 = b == (1 - a) / 2;
>> isolate(eqn1, a)
ans =
a == 1 - 2*b
>> isolate(eqn1, b)
ans =
b == 0.5000 - 0.5000*a
댓글 수: 2
Walter Roberson
2023년 1월 29일
.. Though mind you, that was not an option back in 2012 !
Star Strider
2023년 1월 29일
Definitely!
I’ve used isolate extensively in my Answers since it was introduced, when its use was appropriate.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!