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

조회 수: 1 (최근 30일)
Xeon Yone
Xeon Yone 2020년 1월 22일
댓글: Walter Roberson 2020년 1월 22일
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.

채택된 답변

Star Strider
Star Strider 2020년 1월 22일
Correct syntax:
syms t x
solve(t==(2*x+1)/(2*x-2),x)
producing:
ans =
(2*t + 1)/(2*t - 2)
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 22일
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.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by