Why ('t=(2x+1)/(2x-2)','x') is unsolvable?

1 view (last 30 days)
The code was:
solve('t=(2x+1)/(2x-2)','x')
t is an uncertain constant
The error message is:
Warning: Support of character vectors that are not valid variable names or define a number will be removed
in a future release. To create symbolic expressions, first create symbolic variables and then use
operations on them.
> In sym> convertExpression (line 1586)
In sym> convertChar (line 1491)
In sym> tomupad (line 1243)
In sym (line 199)
In solve> getEqns (line 406)
In solve (line 226)
Incorrect use of symengine
Unexpected 'identifier'.
Error sym> convertExpression (line 1593)
s = mupadmex ((x));
Error sym> convertChar (line 1491)
s = convertExpression (x);
Error sym> tomupad (line 1243)
S = convertChar (x);
Error sym (line 199)
S.s = tomupad (x);
Error solve> getEqns (line 406)
a = sym (a);
Error solve (line 226)
[eqns, vars, options] = getEqns (varargin {:});
The solution I want to get is a formula containing 't' and use 't' to calculate 'x'
I also tried to solve another equation
solvesolve ('v-u-3 * t ^ 2 = 0', 'v')
The result was
ans =
3 * t ^ 2 + u
I want to get this formula that uses parameters to represent unknowns, rather than x for a particular t.

Accepted Answer

Star Strider
Star Strider on 22 Jan 2020
Correct syntax:
syms t x
solve(t==(2*x+1)/(2*x-2),x)
producing:
ans =
(2*t + 1)/(2*t - 2)
  1 Comment
Walter Roberson
Walter Roberson on 22 Jan 2020
The above is the better way. However in your release you can also
solve('t=(2*x+1)/(2*x-2)','x')
This is not possible in newer versions of MATLAB, only in older versions.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!