Solve one function in terms of another

I want to express y(t) in terms of x(t). For example:
syms x(t) y(t) t
eq=x+2*y==10;
solve(eq,y)
The code gives the following error:
Warning: Unable to find explicit solution. For options, see help. Empty sym: 0-by-1
I would like to have this y(t)=(10-x(t))/2 becasuse then i'm going to combine this equation with others that are differential in function of t.
Thanks.

 Accepted Answer

Use isolate instead of solve in this instance —
syms x(t) y(t) t
eq=x+2*y==10;
soln = isolate(eq,y)
soln = 
LHS = lhs(soln)
LHS = 
RHS = rhs(soln)
RHS = 
.

More Answers (0)

Categories

Products

Release

R2021a

Asked:

on 30 Aug 2021

Answered:

on 31 Aug 2021

Community Treasure Hunt

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

Start Hunting!