symbolic substitution dfgsdfgs dfgsdfgs

2 views (last 30 days)
So i have these equations
syms a b c x y z
eq1 = c == z+b;
eq2 = a == x+y;
s = subs(eq1,z,eq2)
what i am trying to do is very simple but just cannot figure it out.
i am trying to substitute z by a so i can have this expression c = x+y+b
but instead i have this monstrosity
s =
c == (a + b == b + x + y)
if i only do
s = subs(eq1,z,a)
it only substitute "a" but not the expression
s =
c == a + b
how can i get it right ?

Answers (1)

madhan ravi
madhan ravi on 21 Mar 2019
subs(eq1,z,rhs(eq2))
  1 Comment
madhan ravi
madhan ravi on 21 Mar 2019
Alternatively if a is not isolated then:
subs(eq1,z,rhs(isolate(eq2,a)))

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!